summaryrefslogtreecommitdiff
path: root/src/testdir/test_edit.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-06-04 20:34:23 +0200
committerBram Moolenaar <Bram@vim.org>2018-06-04 20:34:23 +0200
commitadb8fbec4f4059d214fe6acf2485ffd35e803450 (patch)
tree6e91c9fd410bb086c611cd0f48cc18d611d1cb91 /src/testdir/test_edit.vim
parentacb9effecc9f54b93398a44cc0ec40e77978e094 (diff)
downloadvim-adb8fbec4f4059d214fe6acf2485ffd35e803450.zip
patch 8.1.0034: cursor not restored with ":edit #"
Problem: Cursor not restored with ":edit #". Solution: Don't assume autocommands moved the cursor when it was moved to the first non-blank.
Diffstat (limited to 'src/testdir/test_edit.vim')
-rw-r--r--src/testdir/test_edit.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_edit.vim b/src/testdir/test_edit.vim
index 7278bcd85..3af8c4c88 100644
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -1387,3 +1387,17 @@ func Test_edit_quit()
only
endfunc
+func Test_edit_alt()
+ " Keeping the cursor line didn't happen when the first line has indent.
+ new
+ call setline(1, [' one', 'two', 'three'])
+ w XAltFile
+ $
+ call assert_equal(3, line('.'))
+ e Xother
+ e #
+ call assert_equal(3, line('.'))
+
+ bwipe XAltFile
+ call delete('XAltFile')
+endfunc