Skip to content

Commit

Permalink
Merge pull request #37 from EinfachToll/master
Browse files Browse the repository at this point in the history
Make boolean settings more reasonable
  • Loading branch information
steveklabnik committed Nov 14, 2015
2 parents 566fa06 + cbd61ca commit 95f2b2a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions after/syntax/rust.vim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
if !exists('g:rust_conceal') || g:rust_conceal == 0 || !has('conceal') || &enc != 'utf-8'
finish
endif

" For those who don't want to see `::`...
if exists('g:rust_conceal_mod_path')
if exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
syn match rustNiceOperator "::" conceal cchar=
endif

Expand All @@ -18,14 +18,14 @@ syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrow
syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=

" For those who don't want to see `pub`...
if exists('g:rust_conceal_pub')
if exists('g:rust_conceal_pub') && g:rust_conceal_pub != 0
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')
if !exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
hi! link Conceal Operator
endif
2 changes: 1 addition & 1 deletion compiler/rustc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif

if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent == 1
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
CompilerSet makeprg=rustc
else
CompilerSet makeprg=rustc\ \%
Expand Down
6 changes: 3 additions & 3 deletions ftplugin/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set cpo&vim
" comments, so we'll use that as our default, but make it easy to switch.
" This does not affect indentation at all (I tested it with and without
" leader), merely whether a leader is inserted by default or not.
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader == 1
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
" but without it, */ gets indented one space even if there were no
" leaders. I'm fairly sure that's a Vim bug.
Expand All @@ -35,7 +35,7 @@ silent! setlocal formatoptions+=j
" otherwise it's better than nothing.
setlocal smartindent nocindent

if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99
endif
Expand Down Expand Up @@ -67,7 +67,7 @@ if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
endif
endif

if has('conceal') && exists('g:rust_conceal')
if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0
let b:rust_set_conceallevel=1
setlocal conceallevel=2
endif
Expand Down

0 comments on commit 95f2b2a

Please sign in to comment.