Restructure mode conponent
This commit is contained in:
parent
b79fd4cc24
commit
daa4cd45b3
|
@ -1,8 +1,7 @@
|
|||
-- Copyright (c) 2020-2021 hoob3rt
|
||||
-- MIT license, see LICENSE for more details.
|
||||
|
||||
local function mode()
|
||||
local mode_map = {
|
||||
local mode_map = {
|
||||
['n'] = 'NORMAL',
|
||||
['no'] = 'O-PENDING',
|
||||
['nov'] = 'O-PENDING',
|
||||
|
@ -32,13 +31,11 @@ local function mode()
|
|||
['r?'] = 'CONFIRM',
|
||||
['!'] = 'SHELL',
|
||||
['t'] = 'TERMINAL',
|
||||
}
|
||||
local function get_mode()
|
||||
}
|
||||
local function mode()
|
||||
local mode_code = vim.api.nvim_get_mode().mode
|
||||
if mode_map[mode_code] == nil then return mode_code end
|
||||
return mode_map[mode_code]
|
||||
end
|
||||
return get_mode()
|
||||
end
|
||||
|
||||
return mode
|
||||
|
|
Loading…
Reference in New Issue