2015-07-18 17:05:45 -04:00
|
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|
|
|
|
|
2015-12-06 05:31:38 -05:00
|
|
|
|
if !exists('g:rust_conceal') || g:rust_conceal == 0 || !has('conceal') || &enc != 'utf-8'
|
2013-09-26 06:44:31 -04:00
|
|
|
|
finish
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
" For those who don't want to see `::`...
|
2015-12-06 05:31:38 -05:00
|
|
|
|
if exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
|
2013-09-26 06:44:31 -04:00
|
|
|
|
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`...
|
2015-12-06 05:31:38 -05:00
|
|
|
|
if exists('g:rust_conceal_pub') && g:rust_conceal_pub != 0
|
2013-09-26 06:44:31 -04:00
|
|
|
|
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
|
|
|
|
|
|
2016-06-17 14:47:16 -04:00
|
|
|
|
if !(exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0)
|
2013-09-26 06:44:31 -04:00
|
|
|
|
hi! link Conceal Operator
|
2016-06-17 14:47:16 -04:00
|
|
|
|
|
|
|
|
|
" And keep it after a colorscheme change
|
|
|
|
|
au ColorScheme <buffer> hi! link Conceal Operator
|
2013-09-26 06:44:31 -04:00
|
|
|
|
endif
|
2015-07-18 17:05:45 -04:00
|
|
|
|
|
|
|
|
|
endif
|