aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cursor_spec.lua
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-09-12 11:38:49 -0700
committerJustin M. Keyes <justinkz@gmail.com>2020-09-12 11:42:42 -0700
commit397be5d3805baf3df4e43c0b506986651b54dcbc (patch)
treea09edc35db4f8ddcd827cc9710e9e00931d3e17f /test/functional/ui/cursor_spec.lua
parent1e10342382c11c6b0caf87ad95988afc28c59818 (diff)
downloadrneovim-397be5d3805baf3df4e43c0b506986651b54dcbc.tar.gz
rneovim-397be5d3805baf3df4e43c0b506986651b54dcbc.tar.bz2
rneovim-397be5d3805baf3df4e43c0b506986651b54dcbc.zip
UI: fix cursor not displayed after hiding and un-hiding #12811
- TUI: Fix a case where the cursor was not displayed after hiding the cursor and then setting it to be displayed again. - Change to reset everything before setting guicursor. fixes #12800 close #12811 Steps to reproduce: nvim -u NORC :set termguicolors :hi nCursor guifg=red guibg=red :hi iCursor guifg=green guibg=green :hi cCursor guifg=blue guibg=blue :set guicursor=n:block-nCursor,i:hor25-iCursor,c:ver25-cCursor :set guicursor-=c:ver25-cCursor Actual behaviour: Cursor is a blue vertical. Expected behaviour: Cursor should be the default color block.
Diffstat (limited to 'test/functional/ui/cursor_spec.lua')
-rw-r--r--test/functional/ui/cursor_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua
index 6c913124ac..e1a72ced05 100644
--- a/test/functional/ui/cursor_spec.lua
+++ b/test/functional/ui/cursor_spec.lua
@@ -286,6 +286,21 @@ describe('ui/cursor', function()
eq(173, named.normal.blinkon)
eq(42, named.showmatch.cell_percentage)
end)
+
+ -- If there is no setting for guicursor, it becomes the default setting.
+ meths.set_option('guicursor', 'n:ver35-blinkwait171-blinkoff172-blinkon173-Cursor/lCursor')
+ screen:expect(function()
+ for _,m in ipairs(screen._mode_info) do
+ if m.name ~= 'normal' then
+ eq('block', m.cursor_shape or 'block')
+ eq(0, m.blinkon or 0)
+ eq(0, m.blinkoff or 0)
+ eq(0, m.blinkwait or 0)
+ eq(0, m.hl_id or 0)
+ eq(0, m.id_lm or 0)
+ end
+ end
+ end)
end)
it("empty 'guicursor' sets cursor_shape=block in all modes", function()
@@ -297,6 +312,8 @@ describe('ui/cursor', function()
if m['cursor_shape'] ~= nil then
eq('block', m.cursor_shape)
eq(0, m.blinkon)
+ eq(0, m.hl_id)
+ eq(0, m.id_lm)
end
end
end)