mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 05:48:17 +00:00
lint
This commit is contained in:
@@ -423,7 +423,7 @@ format_luav = function(v, indent, opts)
|
|||||||
if opts.literal_strings then
|
if opts.literal_strings then
|
||||||
ret = v
|
ret = v
|
||||||
else
|
else
|
||||||
quote = opts.dquote_strings and '"' or '\''
|
local quote = opts.dquote_strings and '"' or '\''
|
||||||
ret = quote .. tostring(v):gsub(
|
ret = quote .. tostring(v):gsub(
|
||||||
opts.dquote_strings and '["\\]' or '[\'\\]',
|
opts.dquote_strings and '["\\]' or '[\'\\]',
|
||||||
'\\%0'):gsub(
|
'\\%0'):gsub(
|
||||||
@@ -493,7 +493,7 @@ local function format_string(fmt, ...)
|
|||||||
arg = getarg()
|
arg = getarg()
|
||||||
end
|
end
|
||||||
if subfmt:sub(-1) == 'r' or subfmt:sub(-1) == 'q' then
|
if subfmt:sub(-1) == 'r' or subfmt:sub(-1) == 'q' then
|
||||||
-- %r is like built-in %q, but it is supposed to single-quote strings and
|
-- %r is like built-in %q, but it is supposed to single-quote strings and
|
||||||
-- not double-quote them, and also work not only for strings.
|
-- not double-quote them, and also work not only for strings.
|
||||||
-- Builtin %q is replaced here as it gives invalid and inconsistent with
|
-- Builtin %q is replaced here as it gives invalid and inconsistent with
|
||||||
-- luajit results for e.g. "\e" on lua: luajit transforms that into `\27`,
|
-- luajit results for e.g. "\e" on lua: luajit transforms that into `\27`,
|
||||||
|
Reference in New Issue
Block a user