Make Nvim work with latest vim-patch v7.4.2024

v7.4.2024 changed a few function signatures of functions that we use in
Neovim-specific code, e.g. the API.

Due to that the commit for 7.4.2024 doesn't build on its own, only together with
this commit.
This commit is contained in:
Marco Hinz 2017-01-09 18:39:31 +01:00 committed by James McCoy
parent c05e7f0fdd
commit d3f97232e8
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
3 changed files with 10 additions and 10 deletions

View File

@ -290,7 +290,6 @@ void nvim_buf_set_lines(uint64_t channel_id,
return;
}
buf_T *save_curbuf = NULL;
win_T *save_curwin = NULL;
tabpage_T *save_curtab = NULL;
size_t new_len = replacement.size;
@ -322,6 +321,7 @@ void nvim_buf_set_lines(uint64_t channel_id,
}
try_start();
bufref_T save_curbuf = { NULL, 0 };
switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf);
if (u_save((linenr_T)(start - 1), (linenr_T)end) == FAIL) {
@ -389,7 +389,7 @@ void nvim_buf_set_lines(uint64_t channel_id,
// changed range, and move any in the remainder of the buffer.
// Only adjust marks if we managed to switch to a window that holds
// the buffer, otherwise line numbers will be invalid.
if (save_curbuf == NULL) {
if (save_curbuf.br_buf == NULL) {
mark_adjust((linenr_T)start, (linenr_T)(end - 1), MAXLNUM, extra);
}
@ -405,7 +405,7 @@ end:
}
xfree(lines);
restore_win_for_buf(save_curwin, save_curtab, save_curbuf);
restore_win_for_buf(save_curwin, save_curtab, &save_curbuf);
try_end(err);
}
@ -651,13 +651,13 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err)
}
pos_T *posp;
buf_T *savebuf;
char mark = *name.data;
try_start();
switch_buffer(&savebuf, buf);
bufref_T save_buf;
switch_buffer(&save_buf, buf);
posp = getmark(mark, false);
restore_buffer(savebuf);
restore_buffer(&save_buf);
if (try_end(err)) {
return rv;

View File

@ -899,7 +899,7 @@ static void set_option_value_for(char *key,
{
win_T *save_curwin = NULL;
tabpage_T *save_curtab = NULL;
buf_T *save_curbuf = NULL;
bufref_T save_curbuf = { NULL, 0 };
try_start();
switch (opt_type)
@ -922,7 +922,7 @@ static void set_option_value_for(char *key,
case SREQ_BUF:
switch_buffer(&save_curbuf, (buf_T *)from);
set_option_value_err(key, numval, stringval, opt_flags, err);
restore_buffer(save_curbuf);
restore_buffer(&save_curbuf);
break;
case SREQ_GLOBAL:
set_option_value_err(key, numval, stringval, opt_flags, err);

View File

@ -81,12 +81,12 @@ static inline void restore_win_for_buf(win_T *save_curwin,
#define WITH_BUFFER(b, code) \
do { \
buf_T *save_curbuf = NULL; \
win_T *save_curwin = NULL; \
tabpage_T *save_curtab = NULL; \
bufref_T save_curbuf = { NULL, 0 }; \
switch_to_win_for_buf(b, &save_curwin, &save_curtab, &save_curbuf); \
code; \
restore_win_for_buf(save_curwin, save_curtab, save_curbuf); \
restore_win_for_buf(save_curwin, save_curtab, &save_curbuf); \
} while (0)