Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Backports:SLE-15-SP4:RebuildFactoryUpdates
neovim
make-tree-sitter-optional.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File make-tree-sitter-optional.patch of Package neovim
From: Jakub Jirutka <jakub@jirutka.cz> Date: Thu, 23 May 2024 20:07:15 +0200 Subject: Fallback to classic syntax highlighting if tree-sitter parser is not available See https://gitlab.alpinelinux.org/alpine/aports/-/issues/16132, https://github.com/neovim/neovim/pull/26824 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -1,5 +1,8 @@ -- use treesitter over syntax (for highlighted code blocks) -vim.treesitter.start() +local ok, _ = pcall(vim.treesitter.start) +if not ok then + print('Note: tree-sitter-vimdoc package is not installed, some features will not work') +end -- add custom highlights for list in `:h highlight-groups` local bufname = vim.fs.normalize(vim.api.nvim_buf_get_name(0)) --- a/runtime/ftplugin/lua.lua +++ b/runtime/ftplugin/lua.lua @@ -1,2 +1,5 @@ -- use treesitter over syntax -vim.treesitter.start() +local ok, _ = pcall(vim.treesitter.start) +if not ok then + print('Note: tree-sitter-lua package is not installed, some features will not work') +end --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -9,7 +9,10 @@ -- Do not set vim.b.did_ftplugin = 1 to allow loading of ftplugin/lisp.vim -- use treesitter over syntax -vim.treesitter.start() +local ok, _ = pcall(vim.treesitter.start) +if not ok then + print('Note: tree-sitter-query package is not installed, some features will not work') +end -- set omnifunc vim.bo.omnifunc = 'v:lua.vim.treesitter.query.omnifunc'
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor