mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
vim-patch:8.1.2302: :lockmarks does not work for '[ and ']
Problem: :lockmarks does not work for '[ and '].
Solution: save and restore '[ and '] marks. (James McCoy, closes vim/vim#5222)
f4a1d1c054
Test_diff_maintains_change_mark doesn't actually fail without these changes.
This is fixed in v8.2.3936.
This commit is contained in:
@@ -790,9 +790,14 @@ static int diff_write(buf_T *buf, diffin_T *din)
|
||||
// Always use 'fileformat' set to "unix".
|
||||
char_u *save_ff = buf->b_p_ff;
|
||||
buf->b_p_ff = vim_strsave((char_u *)FF_UNIX);
|
||||
const bool save_lockmarks = cmdmod.lockmarks;
|
||||
// Writing the buffer is an implementation detail of performing the diff,
|
||||
// so it shouldn't update the '[ and '] marks.
|
||||
cmdmod.lockmarks = true;
|
||||
int r = buf_write(buf, din->din_fname, NULL,
|
||||
(linenr_T)1, buf->b_ml.ml_line_count,
|
||||
NULL, false, false, false, true);
|
||||
cmdmod.lockmarks = save_lockmarks;
|
||||
free_string_option(buf->b_p_ff);
|
||||
buf->b_p_ff = save_ff;
|
||||
return r;
|
||||
|
Reference in New Issue
Block a user