mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
test/functional/helpers.lua: Fix dedent() #4735
The character class %s also matches a newline in lua, that's not really what we want here. It works in the other cases in this function, so I left them, but the final gsub should preserve newlines.
This commit is contained in:
parent
a524200ca7
commit
48b2faead8
@ -176,7 +176,7 @@ local function dedent(str)
|
|||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
-- create a pattern for the indent
|
-- create a pattern for the indent
|
||||||
indent = indent:gsub('%s', '%%s')
|
indent = indent:gsub('%s', '[ \t]')
|
||||||
-- strip it from the first line
|
-- strip it from the first line
|
||||||
str = str:gsub('^'..indent, '')
|
str = str:gsub('^'..indent, '')
|
||||||
-- strip it from the remaining lines
|
-- strip it from the remaining lines
|
||||||
|
Loading…
Reference in New Issue
Block a user