feat(Mode): adapt to showmode option

This commit is contained in:
Iron-E 2023-02-20 14:19:20 -05:00
parent ba75e9b4d3
commit 69beec5e8e
No known key found for this signature in database
GPG Key ID: 83A6AEB40395D40D

View File

@ -137,7 +137,7 @@ function Mode:get_user_input()
end
-- echo the indicator.
utils.api.hi_echo(self.indicator)
self:show_name()
-- capture input.
local user_input = vim.fn.getchar()
@ -209,6 +209,13 @@ return
Mode
)
self.show_name = (not vim.o.showmode) and utils.api.redraw or function()
utils.api.redraw()
vim.api.nvim_command('echohl ' .. self.indicator.hl .. " | echon '" .. self.indicator.str .. "'")
vim.api.nvim_command 'echohl None'
end
-- define the exit flag
self.supress_exit = supress_exit or false