Skip to content

Commit aed1846

Browse files
committed
feat: extract conceal for newline out of fancy
refer: #3237
1 parent e98adc1 commit aed1846

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

autoload/vimtex/options.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ function! vimtex#options#init() abort " {{{1
339339
\ 'ligatures': 1,
340340
\ 'cites': 1,
341341
\ 'fancy': 1,
342+
\ 'texTabularChar': 1,
342343
\ 'spacing': 1,
343344
\ 'greek': 1,
344345
\ 'math_bounds': 1,

autoload/vimtex/syntax/core.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,11 @@ function! vimtex#syntax#core#init_rules() abort " {{{1
704704
call s:match_conceal_fancy()
705705
endif
706706

707+
" Conceal tabular characters
708+
if g:vimtex_syntax_conceal.texTabularChar
709+
syntax match texTabularChar "\\\\" conceal cchar=
710+
endif
711+
707712
" Conceal spacing commands
708713
if g:vimtex_syntax_conceal.spacing
709714
call s:match_conceal_spacing()
@@ -2488,7 +2493,6 @@ function! s:match_conceal_fancy() abort " {{{1
24882493
syntax match texCmd "\%#=1\\dots\>" conceal cchar=
24892494
syntax match texCmd "\%#=1\\slash\>" conceal cchar=/
24902495
syntax match texCmd "\%#=1\\ldots\>" conceal cchar=
2491-
syntax match texTabularChar "\\\\" conceal cchar=
24922496

24932497
syntax match texCmdItem "\%#=1\\item\>" conceal cchar=
24942498
\ nextgroup=texItemLabelConcealed

doc/vimtex.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,9 @@ OPTIONS *vimtex-options*
25192519
fancy ~
25202520
Some extra fancy replacements, e.g. `\item` --> ○.
25212521

2522+
texTabularChar ~
2523+
Conceal tabular line breaks, i.e. `\\` --> `⏎`.
2524+
25222525
spacing ~
25232526
Conceal spacing commands such as `\quad` and `\hspace{1em}` in both
25242527
normal mode and math mode.
@@ -2569,6 +2572,7 @@ OPTIONS *vimtex-options*
25692572
\ 'ligatures': 1,
25702573
\ 'cites': 1,
25712574
\ 'fancy': 1,
2575+
\ 'texTabularChar': 1,
25722576
\ 'spacing': 1,
25732577
\ 'greek': 1,
25742578
\ 'math_bounds': 1,

0 commit comments

Comments
 (0)