aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2024-10-22 00:18:16 +0200
committerChristian Clason <ch.clason+github@icloud.com>2024-10-22 09:10:46 +0200
commita25ec00f8886c9b87e9423aedd498cec9419508b (patch)
tree4e192cdc2a727777df245e3cc0f294b9e75c1dcf /runtime/ftplugin
parenta6d1165771781732cb8ff6105df6f0429c46cde1 (diff)
downloadrneovim-a25ec00f8886c9b87e9423aedd498cec9419508b.tar.gz
rneovim-a25ec00f8886c9b87e9423aedd498cec9419508b.tar.bz2
rneovim-a25ec00f8886c9b87e9423aedd498cec9419508b.zip
vim-patch:421ed14: runtime(typst): add folding to typst ftplugin
closes: vim/vim#15897 https://github.com/vim/vim/commit/421ed14b8a0f50e0d2d9247dda49feb69352bd0d Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/typst.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/ftplugin/typst.vim b/runtime/ftplugin/typst.vim
index 895fc688d9..3841e427f3 100644
--- a/runtime/ftplugin/typst.vim
+++ b/runtime/ftplugin/typst.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Typst
" Maintainer: Gregory Anders
-" Last Change: 2024 Oct 04
+" Last Change: 2024 Oct 21
" Based on: https://github.com/kaarmu/typst.vim
if exists('b:did_ftplugin')
@@ -21,6 +21,12 @@ if get(g:, 'typst_conceal', 0)
let b:undo_ftplugin .= ' cole<'
endif
+if has("folding") && get(g:, 'typst_folding', 0)
+ setlocal foldexpr=typst#foldexpr()
+ setlocal foldmethod=expr
+ let b:undo_ftplugin .= "|setl foldexpr< foldmethod<"
+endif
+
if !exists('current_compiler')
compiler typst
let b:undo_ftplugin ..= "| compiler make"