mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
05e45b9e36
We shouldn't be setting conceallevel in the syntax file. Besides not being able to undo this if we switch to another syntax later, it also interferes with embedding rust in other filetypes (such as markdown). Instead, set it in the ftplugin, where it belongs.
32 lines
1.1 KiB
VimL
32 lines
1.1 KiB
VimL
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
|
||
finish
|
||
endif
|
||
|
||
" For those who don't want to see `::`...
|
||
if exists('g:rust_conceal_mod_path')
|
||
syn match rustNiceOperator "::" conceal cchar=ㆍ
|
||
endif
|
||
|
||
syn match rustRightArrowHead contained ">" conceal cchar=
|
||
syn match rustRightArrowTail contained "-" conceal cchar=⟶
|
||
syn match rustNiceOperator "->" contains=rustRightArrowHead,rustRightArrowTail
|
||
|
||
syn match rustFatRightArrowHead contained ">" conceal cchar=
|
||
syn match rustFatRightArrowTail contained "=" conceal cchar=⟹
|
||
syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrowTail
|
||
|
||
syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=′
|
||
|
||
" For those who don't want to see `pub`...
|
||
if exists('g:rust_conceal_pub')
|
||
syn match rustPublicSigil contained "pu" conceal cchar=*
|
||
syn match rustPublicRest contained "b" conceal cchar=
|
||
syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest
|
||
endif
|
||
|
||
hi link rustNiceOperator Operator
|
||
|
||
if !exists('g:rust_conceal_mod_path')
|
||
hi! link Conceal Operator
|
||
endif
|