Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alpine
aports
Commits
38613459
Commit
38613459
authored
10 months ago
by
Jakub Jirutka
Browse files
Options
Downloads
Patches
Plain Diff
community/neovim: don't crash if tree-sitter is not installed
Resolves
#16132
parent
9f71cc06
No related branches found
No related tags found
3 merge requests
!75268
main/postgresql15: security upgrade to 15.9
,
!75022
community/linux-edge: add hexdump to makedepends
,
!66448
[3.20] community/neovim: don't crash if tree-sitter is not installed
Pipeline
#236351
passed
10 months ago
Stage: verify
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
community/neovim/APKBUILD
+3
-1
3 additions, 1 deletion
community/neovim/APKBUILD
community/neovim/make-tree-sitter-optional.patch
+43
-0
43 additions, 0 deletions
community/neovim/make-tree-sitter-optional.patch
with
46 additions
and
1 deletion
community/neovim/APKBUILD
+
3
−
1
View file @
38613459
...
...
@@ -4,7 +4,7 @@
# TODO: Try to trim the base package to include only common syntax files etc.
pkgname
=
neovim
pkgver
=
0.10.0
pkgrel
=
0
pkgrel
=
1
pkgdesc
=
"Vim-fork focused on extensibility and agility"
url
=
"https://neovim.io/"
arch
=
"all"
...
...
@@ -33,6 +33,7 @@ esac
subpackages
=
"
$pkgname
-lang
$pkgname
-doc"
options
=
"!check"
# unit and functional tests fail
source
=
"https://github.com/neovim/neovim/archive/v
$pkgver
/neovim-
$pkgver
.tar.gz
make-tree-sitter-optional.patch
nodoc.txt
"
# secfixes:
...
...
@@ -100,5 +101,6 @@ doc() {
sha512sums
=
"
878cb58729a18179b38303bd9cf79e38997c87946665ac4e7b76d87e15f5d001028fd1454ce30b20773b20a4fe929dfa399fc2ec7f6db0774a4e864c9e8586c1 neovim-0.10.0.tar.gz
660c83a863b8467a7f19febe4cae6f3ea08f985d5fda0c7466e00936c7b8113bf53077d4bd9a983744f131a68346da2f098425695f4c7c7fdd3244b26ee76927 make-tree-sitter-optional.patch
72ab288f53acddc088c567aafe8c5afa6835325fab7879e782d1d62f87a662f3a6bac123c450debbae1b32336cc60b2830b429838ee3dfcc7524773b5069f4f0 nodoc.txt
"
This diff is collapsed.
Click to expand it.
community/neovim/make-tree-sitter-optional.patch
0 → 100644
+
43
−
0
View file @
38613459
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'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment