summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-10-07 17:46:42 +0200
committerBram Moolenaar <Bram@vim.org>2018-10-07 17:46:42 +0200
commitdf77cef92ec034796723ffa3adb12e8b46daa98e (patch)
treeb7106c402d4d687ede7623fcb1b954e5b879f8c4 /src/diff.c
parent0cc7b2d6ccc79d6ce69f5405f9914a42cb4f615e (diff)
downloadvim-git-df77cef92ec034796723ffa3adb12e8b46daa98e.tar.gz
patch 8.1.0458: ml_get error and crash when using "do"v8.1.0458
Problem: Ml_get error and crash when using "do". Solution: Adjust cursor position also when diffupdate is not needed. (Hirohito Higashi)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/diff.c b/src/diff.c
index d63bd9373..054924e67 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -2848,18 +2848,19 @@ ex_diffgetput(exarg_T *eap)
theend:
diff_busy = FALSE;
if (diff_need_update)
- {
- diff_need_update = FALSE;
ex_diffupdate(NULL);
- }
+
+ // Check that the cursor is on a valid character and update it's
+ // position. When there were filler lines the topline has become
+ // invalid.
+ check_cursor();
+ changed_line_abv_curs();
+
+ if (diff_need_update)
+ // redraw already done by ex_diffupdate()
+ diff_need_update = FALSE;
else
{
- // Check that the cursor is on a valid character and update it's
- // position. When there were filler lines the topline has become
- // invalid.
- check_cursor();
- changed_line_abv_curs();
-
// Also need to redraw the other buffers.
diff_redraw(FALSE);
apply_autocmds(EVENT_DIFFUPDATED, NULL, NULL, FALSE, curbuf);