vim-patch:421ed14: runtime(typst): add folding to typst ftplugin

closes: vim/vim#15897

421ed14b8a

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
This commit is contained in:
Christian Clason
2024-10-22 00:18:16 +02:00
committed by Christian Clason
parent a6d1165771
commit a25ec00f88
3 changed files with 46 additions and 2 deletions

View File

@@ -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"