aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-07-14 05:15:04 +0900
committerShougo Matsushita <Shougo.Matsu@gmail.com>2020-07-23 10:29:36 +0900
commitbfe94d0a0814eab5e9f9b6c6b06e770ba904da9f (patch)
treeb4cfe764073ba6bffe541f55d89376d1c47c38cb /src/nvim/testdir
parentd3eddcf630f29da72409934eb14fb7a534f6497e (diff)
downloadrneovim-bfe94d0a0814eab5e9f9b6c6b06e770ba904da9f.tar.gz
rneovim-bfe94d0a0814eab5e9f9b6c6b06e770ba904da9f.tar.bz2
rneovim-bfe94d0a0814eab5e9f9b6c6b06e770ba904da9f.zip
vim-patch:8.1.1623: display wrong with signs in narrow number column
Problem: Display wrong with signs in narrow number column. Solution: Increase the numbercolumn width if needed. (Yegappan Lakshmanan, closes vim/vim#4606) https://github.com/vim/vim/commit/e4b407f536ba8bd007152649a347a95320d80fce
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_signs.vim50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_signs.vim b/src/nvim/testdir/test_signs.vim
index f89095ec5d..9d1146453a 100644
--- a/src/nvim/testdir/test_signs.vim
+++ b/src/nvim/testdir/test_signs.vim
@@ -1796,6 +1796,56 @@ func Test_sign_numcol()
redraw!
call assert_equal("=> 1 01234", s:ScreenLine(1, 1, 11))
+ " Test displaying signs in the number column with width 1
+ call sign_unplace('*')
+ call append(1, "abcde")
+ call append(2, "01234")
+ " Enable number column with width 1
+ set number numberwidth=1 signcolumn=auto
+ redraw!
+ call assert_equal("3 01234", s:ScreenLine(3, 1, 7))
+ " Place a sign and make sure number column width remains the same
+ sign place 20 line=2 name=sign1
+ redraw!
+ call assert_equal("=>2 abcde", s:ScreenLine(2, 1, 9))
+ call assert_equal(" 3 01234", s:ScreenLine(3, 1, 9))
+ " Set 'signcolumn' to 'number', make sure the number column width increases
+ set signcolumn=number
+ redraw!
+ call assert_equal("=> abcde", s:ScreenLine(2, 1, 8))
+ call assert_equal(" 3 01234", s:ScreenLine(3, 1, 8))
+ " Set 'signcolumn' to 'auto', make sure the number column width is 1.
+ set signcolumn=auto
+ redraw!
+ call assert_equal("=>2 abcde", s:ScreenLine(2, 1, 9))
+ call assert_equal(" 3 01234", s:ScreenLine(3, 1, 9))
+ " Set 'signcolumn' to 'number', make sure the number column width is 2.
+ set signcolumn=number
+ redraw!
+ call assert_equal("=> abcde", s:ScreenLine(2, 1, 8))
+ call assert_equal(" 3 01234", s:ScreenLine(3, 1, 8))
+ " Disable 'number' column
+ set nonumber
+ redraw!
+ call assert_equal("=>abcde", s:ScreenLine(2, 1, 7))
+ call assert_equal(" 01234", s:ScreenLine(3, 1, 7))
+ " Enable 'number' column
+ set number
+ redraw!
+ call assert_equal("=> abcde", s:ScreenLine(2, 1, 8))
+ call assert_equal(" 3 01234", s:ScreenLine(3, 1, 8))
+ " Remove the sign and make sure the width of the number column is 1.
+ call sign_unplace('', {'id' : 20})
+ redraw!
+ call assert_equal("3 01234", s:ScreenLine(3, 1, 7))
+ " When the first sign is placed with 'signcolumn' set to number, verify that
+ " the number column width increases
+ sign place 30 line=1 name=sign1
+ redraw!
+ call assert_equal("=> 01234", s:ScreenLine(1, 1, 8))
+ call assert_equal(" 2 abcde", s:ScreenLine(2, 1, 8))
+
+ sign unplace * group=*
sign undefine sign1
set signcolumn&
set number&