-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refer: #2882
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
" VimTeX - LaTeX plugin for Vim | ||
" | ||
" Maintainer: Karl Yngve Lervåg | ||
" Email: karl.yngve@gmail.com | ||
" | ||
|
||
function! vimtex#fold#comment_pkg#new(config) abort " {{{1 | ||
return extend(deepcopy(s:folder), a:config) | ||
endfunction | ||
|
||
" }}}1 | ||
|
||
|
||
let s:folder = { | ||
\ 'name' : 'comment_pkg', | ||
\ 're' : { | ||
\ 'start' : '^\s*\\begin\s*{comment}', | ||
\ 'end' : '^\s*\\end\s*{comment}', | ||
\ }, | ||
\ 'opened' : v:false, | ||
\} | ||
function! s:folder.level(line, lnum) abort dict " {{{1 | ||
if a:line =~# self.re.start | ||
let self.opened = v:true | ||
return 'a1' | ||
elseif a:line =~# self.re.end | ||
let self.opened = v:false | ||
return 's1' | ||
elseif self.opened | ||
return '=' | ||
endif | ||
endfunction | ||
|
||
" }}}1 | ||
function! s:folder.text(line, level) abort dict " {{{1 | ||
return a:line | ||
endfunction | ||
|
||
" }}}1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters