diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-07-09 10:15:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-09 10:15:18 +0200 |
commit | 1c416892879de6b78038f2cc2f1487eff46abb60 (patch) | |
tree | 3895521bc907b7a0617940c21272ac7ee9f052da /src/nvim/diff.c | |
parent | 27118c6eb3351b0df96e2514e8f3806108e50cf7 (diff) | |
parent | 9c93e6461c8c6ec2e8d3e73f506389ac7086d531 (diff) | |
download | rneovim-1c416892879de6b78038f2cc2f1487eff46abb60.tar.gz rneovim-1c416892879de6b78038f2cc2f1487eff46abb60.tar.bz2 rneovim-1c416892879de6b78038f2cc2f1487eff46abb60.zip |
Merge pull request #12971 from vigoux/decurbuf
Decrease reliance on curbuf in BUFEMPTY and `undo.c`
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r-- | src/nvim/diff.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 961615dc9d..299175b28c 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1334,9 +1334,9 @@ static void set_diff_option(win_T *wp, int value) curwin = wp; curbuf = curwin->w_buffer; - curbuf_lock++; + curbuf->b_ro_locked++; set_option_value("diff", (long)value, NULL, OPT_LOCAL); - curbuf_lock--; + curbuf->b_ro_locked--; curwin = old_curwin; curbuf = curwin->w_buffer; } @@ -2603,7 +2603,7 @@ void ex_diffgetput(exarg_T *eap) // FileChangedRO autocommand, which may do nasty things and mess // everything up. if (!curbuf->b_changed) { - change_warning(0); + change_warning(curbuf, 0); if (diff_buf_idx(curbuf) != idx_to) { EMSG(_("E787: Buffer changed unexpectedly")); goto theend; @@ -2669,7 +2669,7 @@ void ex_diffgetput(exarg_T *eap) } } - buf_empty = BUFEMPTY(); + buf_empty = buf_is_empty(curbuf); added = 0; for (i = 0; i < count; ++i) { |