fix #20 move cursor right with grave

This commit is contained in:
windwp 2021-02-03 08:22:30 +07:00
parent d467a8e63e
commit 5ad7fe1c5b
2 changed files with 9 additions and 2 deletions

View File

@ -119,7 +119,7 @@ local function is_in_quote(line, pos)
line:sub(cIndex -1, cIndex -1) ~= "\\"
then
result = false
elseif result == false and (char == "'" or char == '"') then
elseif result == false and (char == "'" or char == '"' or char == '`') then
last_quote = char
result = true
end
@ -136,7 +136,7 @@ MPairs.check_add = function(char)
-- move right when have quote on end line or in quote
-- situtaion |" => "|
if (next_char == "'" or next_char == '"') and next_char == char then
if (next_char == "'" or next_char == '"' or next_char == '`') and next_char == char then
if next_col == string.len(line) then
return 2
end

View File

@ -70,6 +70,13 @@ local data = {
before = [[("abcd|")]],
after = [[("abcd"|)]]
},
{
name = "move right when inside grave with special slash" ,
key = [[`]],
before = [[(`abcd\"|`)]],
after = [[(`abcd\"`|)]]
},
{
name = "move right when inside quote with special slash" ,
key = [["]],