on master help sign in
fix(fastwrap): offset change on end line.
commitfc2a14524285cca79be236f7df43d5ebe456ba3c authorzztrieuzz <trieu19@gmail.com> dateMon 11 Apr 2022, 17:46 (5 years ago) parent06535b1
1 file changed+2−1
lua/nvim-autopairs/fastwrap.lua+2−1
lua/nvim-autopairs/fastwrap.lua+2−1
@@ -73,6 +73,7 @@ M.show = function(line)
7373 if i == str_length then
7474 is_end_key = false
7575 key = config.end_key
76+ offset = 0
7677 end
7778 table.insert(
7879 list_pos,
@@ -110,11 +111,11 @@ M.show = function(line)
110111end
111112
112113M.move_bracket = function(line, target_pos, end_pair, change_pos)
114+ log.debug(target_pos)
113115 line = line or utils.text_get_current_line(0)
114116 local row, col = utils.get_cursor()
115117 local _, next_char = utils.text_cusor_line(line, col, 1, 1, false)
116118 -- remove an autopairs if that exist
117− -- ((fsadfsa)) dsafdsa
118119 if next_char == end_pair then
119120 line = line:sub(1, col) .. line:sub(col + 2, #line)
120121 target_pos = target_pos - 1