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"
This commit is contained in:
HE7086 2022-04-24 07:29:53 +02:00 committed by GitHub
parent 18a07f790e
commit 43c69a3479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 36 deletions

View File

@ -7,7 +7,7 @@ local default_options = {
} }
function M:init(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) M.super.init(self, options)
self.options = vim.tbl_deep_extend('keep', self.options or {}, default_options) self.options = vim.tbl_deep_extend('keep', self.options or {}, default_options)

View File

@ -4,41 +4,41 @@ local Mode = {}
-- stylua: ignore -- stylua: ignore
Mode.map = { Mode.map = {
['n'] = 'NORMAL', ['n'] = 'NORMAL',
['no'] = 'O-PENDING', ['no'] = 'O-PENDING',
['nov'] = 'O-PENDING', ['nov'] = 'O-PENDING',
['noV'] = 'O-PENDING', ['noV'] = 'O-PENDING',
['no'] = 'O-PENDING', ['no\x16'] = 'O-PENDING',
['niI'] = 'NORMAL', ['niI'] = 'NORMAL',
['niR'] = 'NORMAL', ['niR'] = 'NORMAL',
['niV'] = 'NORMAL', ['niV'] = 'NORMAL',
['nt'] = 'NORMAL', ['nt'] = 'NORMAL',
['v'] = 'VISUAL', ['v'] = 'VISUAL',
['vs'] = 'VISUAL', ['vs'] = 'VISUAL',
['V'] = 'V-LINE', ['V'] = 'V-LINE',
['Vs'] = 'V-LINE', ['Vs'] = 'V-LINE',
[''] = 'V-BLOCK', ['\x16'] = 'V-BLOCK',
['s'] = 'V-BLOCK', ['\x16s'] = 'V-BLOCK',
['s'] = 'SELECT', ['s'] = 'SELECT',
['S'] = 'S-LINE', ['S'] = 'S-LINE',
[''] = 'S-BLOCK', ['\x13'] = 'S-BLOCK',
['i'] = 'INSERT', ['i'] = 'INSERT',
['ic'] = 'INSERT', ['ic'] = 'INSERT',
['ix'] = 'INSERT', ['ix'] = 'INSERT',
['R'] = 'REPLACE', ['R'] = 'REPLACE',
['Rc'] = 'REPLACE', ['Rc'] = 'REPLACE',
['Rx'] = 'REPLACE', ['Rx'] = 'REPLACE',
['Rv'] = 'V-REPLACE', ['Rv'] = 'V-REPLACE',
['Rvc'] = 'V-REPLACE', ['Rvc'] = 'V-REPLACE',
['Rvx'] = 'V-REPLACE', ['Rvx'] = 'V-REPLACE',
['c'] = 'COMMAND', ['c'] = 'COMMAND',
['cv'] = 'EX', ['cv'] = 'EX',
['ce'] = 'EX', ['ce'] = 'EX',
['r'] = 'REPLACE', ['r'] = 'REPLACE',
['rm'] = 'MORE', ['rm'] = 'MORE',
['r?'] = 'CONFIRM', ['r?'] = 'CONFIRM',
['!'] = 'SHELL', ['!'] = 'SHELL',
['t'] = 'TERMINAL', ['t'] = 'TERMINAL',
} }
---@return string current mode name ---@return string current mode name