Restructure mode conponent
This commit is contained in:
parent
b79fd4cc24
commit
daa4cd45b3
|
@ -1,7 +1,6 @@
|
|||
-- Copyright (c) 2020-2021 hoob3rt
|
||||
-- MIT license, see LICENSE for more details.
|
||||
|
||||
local function mode()
|
||||
local mode_map = {
|
||||
['n'] = 'NORMAL',
|
||||
['no'] = 'O-PENDING',
|
||||
|
@ -33,12 +32,10 @@ local function mode()
|
|||
['!'] = '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