mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-11 07:15:44 +03:00
fix #20 move cursor right with grave
This commit is contained in:
parent
d467a8e63e
commit
5ad7fe1c5b
@ -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
|
||||
|
@ -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 = [["]],
|
||||
|
Loading…
Reference in New Issue
Block a user