diff options
| author | hc <hc@email.ch> | 2024-09-25 14:47:41 +0800 |
|---|---|---|
| committer | hc <hc@email.ch> | 2024-09-25 14:47:41 +0800 |
| commit | a2f703ec02bc1589a540b67b9c82683043c622b2 (patch) | |
| tree | 4412a7c30fbf603a3041c1d3acb076f2d039bafd /setup.sh | |
| parent | fe118ae654fd001266e0620521b936790d49cb99 (diff) | |
quickfix lvim
Diffstat (limited to 'setup.sh')
| -rwxr-xr-x[-rw-r--r--] | setup.sh | 21 |
1 files changed, 21 insertions, 0 deletions
| @@ -63,7 +63,28 @@ vim.api.nvim_create_autocmd("BufWritePost", { | |||
| 63 | }) | 63 | }) |
| 64 | EOF | 64 | EOF |
| 65 | 65 | ||
| 66 | -- Fix for vim.tbl_add_reverse_lookup deprecation | ||
| 67 | -- Replace any usage of vim.tbl_add_reverse_lookup with: | ||
| 68 | local 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 | ||
| 75 | end | ||
| 66 | 76 | ||
| 77 | -- Fix for vim.treesitter.get_parser warning | ||
| 78 | -- Wrap any usage of vim.treesitter.get_parser with a pcall: | ||
| 79 | local 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 | ||
| 87 | end | ||
| 67 | 88 | ||
| 68 | 89 | ||
| 69 | # add check fro each component | 90 | # add check fro each component |
