Merge branch 'master' into luaviml'/lua

This commit is contained in:
ZyX
2017-04-08 01:54:58 +03:00
207 changed files with 16096 additions and 9169 deletions

View File

@@ -296,7 +296,7 @@ void nvim_buf_set_lines(uint64_t channel_id,
tabpage_T *save_curtab = NULL;
size_t new_len = replacement.size;
size_t old_len = (size_t)(end - start);
ssize_t extra = 0; // lines added to text, can be negative
ptrdiff_t extra = 0; // lines added to text, can be negative
char **lines = (new_len != 0) ? xcalloc(new_len, sizeof(char *)) : NULL;
for (size_t i = 0; i < new_len; i++) {
@@ -342,8 +342,8 @@ void nvim_buf_set_lines(uint64_t channel_id,
}
}
if ((ssize_t)to_delete > 0) {
extra -= (ssize_t)to_delete;
if (to_delete > 0) {
extra -= (ptrdiff_t)to_delete;
}
// For as long as possible, replace the existing old_len with the
@@ -395,10 +395,10 @@ void nvim_buf_set_lines(uint64_t channel_id,
mark_adjust((linenr_T)start, (linenr_T)(end - 1), MAXLNUM, extra);
}
changed_lines((linenr_T)start, 0, (linenr_T)end, extra);
changed_lines((linenr_T)start, 0, (linenr_T)end, (long)extra);
if (save_curbuf.br_buf == NULL) {
fix_cursor((linenr_T)start, (linenr_T)end, extra);
fix_cursor((linenr_T)start, (linenr_T)end, (linenr_T)extra);
}
end: