summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhc <hc@email.ch>2024-09-25 14:47:41 +0800
committerhc <hc@email.ch>2024-09-25 14:47:41 +0800
commita2f703ec02bc1589a540b67b9c82683043c622b2 (patch)
tree4412a7c30fbf603a3041c1d3acb076f2d039bafd
parentfe118ae654fd001266e0620521b936790d49cb99 (diff)
quickfix lvim
-rwxr-xr-x[-rw-r--r--]reset-ssh-connections.sh0
-rwxr-xr-x[-rw-r--r--]setup.sh21
2 files changed, 21 insertions, 0 deletions
diff --git a/reset-ssh-connections.sh b/reset-ssh-connections.sh
index f19300d..f19300d 100644..100755
--- a/reset-ssh-connections.sh
+++ b/reset-ssh-connections.sh
diff --git a/setup.sh b/setup.sh
index f3e18a6..5e103be 100644..100755
--- a/setup.sh
+++ b/setup.sh
@@ -63,7 +63,28 @@ vim.api.nvim_create_autocmd("BufWritePost", {
})
EOF
+-- Fix for vim.tbl_add_reverse_lookup deprecation
+-- Replace any usage of vim.tbl_add_reverse_lookup with:
+local function add_reverse_lookup(tbl)
+ local result = {}
+ for k, v in pairs(tbl) do
+ result[k] = v
+ result[v] = k
+ end
+ return result
+end
+-- Fix for vim.treesitter.get_parser warning
+-- Wrap any usage of vim.treesitter.get_parser with a pcall:
+local function safe_get_parser(bufnr, lang)
+ local ok, parser = pcall(vim.treesitter.get_parser, bufnr, lang)
+ if ok then
+ return parser
+ else
+ -- Handle the error or return nil
+ return nil
+ end
+end
# add check fro each component