summaryrefslogtreecommitdiff
path: root/setup.sh
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 /setup.sh
parentfe118ae654fd001266e0620521b936790d49cb99 (diff)
quickfix lvim
Diffstat (limited to 'setup.sh')
-rwxr-xr-x[-rw-r--r--]setup.sh21
1 files changed, 21 insertions, 0 deletions
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", {
63}) 63})
64EOF 64EOF
65 65
66-- Fix for vim.tbl_add_reverse_lookup deprecation
67-- Replace any usage of vim.tbl_add_reverse_lookup with:
68local function add_reverse_lookup(tbl)
69 local result = {}
70 for k, v in pairs(tbl) do
71 result[k] = v
72 result[v] = k
73 end
74 return result
75end
66 76
77-- Fix for vim.treesitter.get_parser warning
78-- Wrap any usage of vim.treesitter.get_parser with a pcall:
79local function safe_get_parser(bufnr, lang)
80 local ok, parser = pcall(vim.treesitter.get_parser, bufnr, lang)
81 if ok then
82 return parser
83 else
84 -- Handle the error or return nil
85 return nil
86 end
87end
67 88
68 89
69# add check fro each component 90# add check fro each component