aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_edit.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_edit.vim')
-rw-r--r--src/nvim/testdir/test_edit.vim40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim
index 8f815478c2..d2474c06fe 100644
--- a/src/nvim/testdir/test_edit.vim
+++ b/src/nvim/testdir/test_edit.vim
@@ -1323,3 +1323,43 @@ func Test_edit_quit()
only
endfunc
+func Test_edit_complete_very_long_name()
+ if !has('unix')
+ " Long directory names only work on Unix.
+ return
+ endif
+
+ let dirname = getcwd() . "/Xdir"
+ let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
+ try
+ call mkdir(longdirname, 'p')
+ catch /E739:/
+ " Long directory name probably not supported.
+ call delete(dirname, 'rf')
+ return
+ endtry
+
+ " Try to get the Vim window position before setting 'columns'.
+ let winposx = getwinposx()
+ let winposy = getwinposy()
+ let save_columns = &columns
+ " Need at least about 1100 columns to reproduce the problem.
+ set columns=2000
+ call assert_equal(2000, &columns)
+ set noswapfile
+
+ let longfilename = longdirname . '/' . repeat('a', 255)
+ call writefile(['Totum', 'Table'], longfilename)
+ new
+ exe "next Xfile " . longfilename
+ exe "normal iT\<C-N>"
+
+ bwipe!
+ exe 'bwipe! ' . longfilename
+ call delete(dirname, 'rf')
+ let &columns = save_columns
+ if winposx >= 0 && winposy >= 0
+ exe 'winpos ' . winposx . ' ' . winposy
+ endif
+ set swapfile&
+endfunc