From 43c69a34796ed27854e3e8ed631b182a4b8c04b9 Mon Sep 17 00:00:00 2001 From: HE7086 Date: Sun, 24 Apr 2022 07:29:53 +0200 Subject: [PATCH] Use escape sequence instead of raw binaries (#662) * Fix: use escape sequence instead of binary chars binary data will confuse some programs e.g. file and treat the code as "data" instead of "text" * Fix: remove redundant binary character "0x1a" --- lua/lualine/components/windows/init.lua | 2 +- lua/lualine/utils/mode.lua | 70 ++++++++++++------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/lua/lualine/components/windows/init.lua b/lua/lualine/components/windows/init.lua index f8d95a0..0ee6a95 100644 --- a/lua/lualine/components/windows/init.lua +++ b/lua/lualine/components/windows/init.lua @@ -7,7 +7,7 @@ local default_options = { } function M:init(options) - options.buffers_color = nil -- bufers_color isn't windpws option. + options.buffers_color = nil -- bufers_color isn't windpws option. M.super.init(self, options) self.options = vim.tbl_deep_extend('keep', self.options or {}, default_options) diff --git a/lua/lualine/utils/mode.lua b/lua/lualine/utils/mode.lua index 9f96d4c..e17bdae 100644 --- a/lua/lualine/utils/mode.lua +++ b/lua/lualine/utils/mode.lua @@ -4,41 +4,41 @@ local Mode = {} -- stylua: ignore Mode.map = { - ['n'] = 'NORMAL', - ['no'] = 'O-PENDING', - ['nov'] = 'O-PENDING', - ['noV'] = 'O-PENDING', - ['no'] = 'O-PENDING', - ['niI'] = 'NORMAL', - ['niR'] = 'NORMAL', - ['niV'] = 'NORMAL', - ['nt'] = 'NORMAL', - ['v'] = 'VISUAL', - ['vs'] = 'VISUAL', - ['V'] = 'V-LINE', - ['Vs'] = 'V-LINE', - [''] = 'V-BLOCK', - ['s'] = 'V-BLOCK', - ['s'] = 'SELECT', - ['S'] = 'S-LINE', - [''] = 'S-BLOCK', - ['i'] = 'INSERT', - ['ic'] = 'INSERT', - ['ix'] = 'INSERT', - ['R'] = 'REPLACE', - ['Rc'] = 'REPLACE', - ['Rx'] = 'REPLACE', - ['Rv'] = 'V-REPLACE', - ['Rvc'] = 'V-REPLACE', - ['Rvx'] = 'V-REPLACE', - ['c'] = 'COMMAND', - ['cv'] = 'EX', - ['ce'] = 'EX', - ['r'] = 'REPLACE', - ['rm'] = 'MORE', - ['r?'] = 'CONFIRM', - ['!'] = 'SHELL', - ['t'] = 'TERMINAL', + ['n'] = 'NORMAL', + ['no'] = 'O-PENDING', + ['nov'] = 'O-PENDING', + ['noV'] = 'O-PENDING', + ['no\x16'] = 'O-PENDING', + ['niI'] = 'NORMAL', + ['niR'] = 'NORMAL', + ['niV'] = 'NORMAL', + ['nt'] = 'NORMAL', + ['v'] = 'VISUAL', + ['vs'] = 'VISUAL', + ['V'] = 'V-LINE', + ['Vs'] = 'V-LINE', + ['\x16'] = 'V-BLOCK', + ['\x16s'] = 'V-BLOCK', + ['s'] = 'SELECT', + ['S'] = 'S-LINE', + ['\x13'] = 'S-BLOCK', + ['i'] = 'INSERT', + ['ic'] = 'INSERT', + ['ix'] = 'INSERT', + ['R'] = 'REPLACE', + ['Rc'] = 'REPLACE', + ['Rx'] = 'REPLACE', + ['Rv'] = 'V-REPLACE', + ['Rvc'] = 'V-REPLACE', + ['Rvx'] = 'V-REPLACE', + ['c'] = 'COMMAND', + ['cv'] = 'EX', + ['ce'] = 'EX', + ['r'] = 'REPLACE', + ['rm'] = 'MORE', + ['r?'] = 'CONFIRM', + ['!'] = 'SHELL', + ['t'] = 'TERMINAL', } ---@return string current mode name