tui: Enable mode-sensitive cursor by default.

Also give NVIM_TUI_ENABLE_CURSOR_SHAPE more granularity:
0 = do not change cursor shape
1 = non-blinking ("steady") cursor with mode-sensitive shape
2 = blinking cursor with mode-sensitive shape

Note: blink state is not changed for Konsole, instead user's terminal
preference makes the decision. (Can't do that for xterm-likes, DECSCUSR
forces us to choose blink-state.)

This is a temporary step until the TUI respects 'guicursor'
Ref: https://github.com/neovim/neovim/issues/2583#issuecomment-272988384
This commit is contained in:
Justin M. Keyes
2017-01-20 01:20:34 +01:00
parent 8684fdda3b
commit ef753a76b9
3 changed files with 20 additions and 14 deletions

View File

@@ -68,7 +68,8 @@
-- })
-- screen:set_default_attr_ignore( {{}, {bold=true, foreground=NonText}} )
--
-- To help write screen tests, see screen:snapshot_util().
-- To help write screen tests, see Screen:snapshot_util().
-- To debug screen tests, see Screen:redraw_debug().
local helpers = require('test.functional.helpers')(nil)
local request, run, uimeths = helpers.request, helpers.run, helpers.uimeths
@@ -520,9 +521,11 @@ function Screen:_current_screen()
return table.concat(rv, '\n')
end
-- Utility to generate/debug tests. Call it where screen:expect() would be.
-- Waits briefly, then dumps the current screen state in the form of
-- screen:expect(). Use snapshot_util({},true) to generate a text-only test.
-- Generates tests. Call it where Screen:expect() would be. Waits briefly, then
-- dumps the current screen state in the form of Screen:expect().
-- Use snapshot_util({},true) to generate a text-only (no attributes) test.
--
-- @see Screen:redraw_debug()
function Screen:snapshot_util(attrs, ignore)
self:sleep(250)
self:print_snapshot(attrs, ignore)