aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/change.c
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-19 12:26:08 -0600
committerJosh Rahm <rahm@google.com>2022-08-19 13:06:41 -0600
commita7237662f96933efe29eed8212464571e3778cd0 (patch)
tree27930202726b4251437c8cfa53069f65b4db90dc /src/nvim/change.c
parent02292344929069ea63c0bb872cc22d552d86b67f (diff)
parentb2f979b30beac67906b2dd717fcb6a34f46f5e54 (diff)
downloadrneovim-a7237662f96933efe29eed8212464571e3778cd0.tar.gz
rneovim-a7237662f96933efe29eed8212464571e3778cd0.tar.bz2
rneovim-a7237662f96933efe29eed8212464571e3778cd0.zip
Merge branch 'master' of https://github.com/neovim/neovim into rahmtmp
Diffstat (limited to 'src/nvim/change.c')
-rw-r--r--src/nvim/change.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/change.c b/src/nvim/change.c
index c063ece907..5184dc0689 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -10,6 +10,7 @@
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
+#include "nvim/drawscreen.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/extmark.h"
@@ -23,7 +24,6 @@
#include "nvim/move.h"
#include "nvim/option.h"
#include "nvim/plines.h"
-#include "nvim/screen.h"
#include "nvim/search.h"
#include "nvim/state.h"
#include "nvim/ui.h"
@@ -421,12 +421,12 @@ void deleted_lines(linenr_T lnum, linenr_T count)
/// be triggered to display the cursor.
void deleted_lines_mark(linenr_T lnum, long count)
{
- // if we deleted the entire buffer, we need to implicitly add a new empty line
bool made_empty = (count > 0) && curbuf->b_ml.ml_flags & ML_EMPTY;
- mark_adjust(lnum, (linenr_T)(lnum + count - 1), (long)MAXLNUM,
- -(linenr_T)count + (made_empty?1:0),
- kExtmarkUndo);
+ mark_adjust(lnum, (linenr_T)(lnum + count - 1), MAXLNUM, -(linenr_T)count, kExtmarkNOOP);
+ // if we deleted the entire buffer, we need to implicitly add a new empty line
+ extmark_adjust(curbuf, lnum, (linenr_T)(lnum + count - 1), MAXLNUM,
+ -(linenr_T)count + (made_empty ? 1 : 0), kExtmarkUndo);
changed_lines(lnum, 0, lnum + (linenr_T)count, (linenr_T)(-count), true);
}