From b18ae5342106533d0328a005801678b0bc104187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Wed, 13 Dec 2023 12:29:06 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20remove(nvim):=20autopai?= =?UTF-8?q?rs=20unused=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/extras/coding/cmp/autopairs.lua | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/.config/nvim/lua/plugins/extras/coding/cmp/autopairs.lua b/.config/nvim/lua/plugins/extras/coding/cmp/autopairs.lua index 97b4a3c0..58856a15 100644 --- a/.config/nvim/lua/plugins/extras/coding/cmp/autopairs.lua +++ b/.config/nvim/lua/plugins/extras/coding/cmp/autopairs.lua @@ -21,45 +21,6 @@ return { local cond = require("nvim-autopairs.conds") local brackets = { { "(", ")" }, { "[", "]" }, { "{", "}" } } - local get_closing_for_line = function(line) - local i = -1 - local clo = "" - - while true do - i, _ = string.find(line, "[%(%)%{%}%[%]]", i + 1) - if i == nil then - break - end - local ch = string.sub(line, i, i) - local st = string.sub(clo, 1, 1) - - if ch == "{" then - clo = "}" .. clo - elseif ch == "}" then - if st ~= "}" then - return "" - end - clo = string.sub(clo, 2) - elseif ch == "(" then - clo = ")" .. clo - elseif ch == ")" then - if st ~= ")" then - return "" - end - clo = string.sub(clo, 2) - elseif ch == "[" then - clo = "]" .. clo - elseif ch == "]" then - if st ~= "]" then - return "" - end - clo = string.sub(clo, 2) - end - end - - return clo - end - local default_handler = cmp_autopairs.filetypes["*"]["("].handler cmp_autopairs.filetypes["*"]["("].handler = function(char, item, bufnr, rules, commit_character) local node_type = ts_utils.get_node_at_cursor():type()