mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-11 07:15:44 +03:00
fix: is_end_line function
This commit is contained in:
parent
5a86b4f83c
commit
e3e105b11a
@ -191,8 +191,9 @@ end
|
|||||||
cond.is_end_line = function()
|
cond.is_end_line = function()
|
||||||
return function(opts)
|
return function(opts)
|
||||||
log.debug('is_end_line')
|
log.debug('is_end_line')
|
||||||
-- if the next char is blank
|
local end_text = opts.line:sub(opts.col + 1)
|
||||||
if opts.next_char ~= "" and opts.next_char:match("%s+") == nil then
|
-- end text is blank
|
||||||
|
if end_text ~= "" and end_text:match("^%s+$") == nil then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -17,8 +17,17 @@ local data = {
|
|||||||
filetype = "lua",
|
filetype = "lua",
|
||||||
linenr = 5,
|
linenr = 5,
|
||||||
key = [[<cr>]],
|
key = [[<cr>]],
|
||||||
before = [[function a()| ]],
|
before = [[function a()| ]],
|
||||||
after = [[ end ]]
|
after = [[ end ]]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "lua function add endwise" ,
|
||||||
|
filepath = './tests/endwise/init.lua',
|
||||||
|
filetype = "lua",
|
||||||
|
linenr = 5,
|
||||||
|
key = [[<cr>]],
|
||||||
|
before = [[function a()|x ab ]],
|
||||||
|
after = [[]]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "add if endwise" ,
|
name = "add if endwise" ,
|
||||||
|
Loading…
Reference in New Issue
Block a user