Skip to content

Commit 95f2b2a

Browse files
committed
Merge pull request rust-lang#37 from EinfachToll/master
Make boolean settings more reasonable
2 parents 566fa06 + cbd61ca commit 95f2b2a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

after/syntax/rust.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
1+
if !exists('g:rust_conceal') || g:rust_conceal == 0 || !has('conceal') || &enc != 'utf-8'
22
finish
33
endif
44

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

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

2020
" For those who don't want to see `pub`...
21-
if exists('g:rust_conceal_pub')
21+
if exists('g:rust_conceal_pub') && g:rust_conceal_pub != 0
2222
syn match rustPublicSigil contained "pu" conceal cchar=
2323
syn match rustPublicRest contained "b" conceal cchar= 
2424
syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest
2525
endif
2626

2727
hi link rustNiceOperator Operator
2828

29-
if !exists('g:rust_conceal_mod_path')
29+
if !exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
3030
hi! link Conceal Operator
3131
endif

compiler/rustc.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if exists(":CompilerSet") != 2
1515
command -nargs=* CompilerSet setlocal <args>
1616
endif
1717

18-
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent == 1
18+
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
1919
CompilerSet makeprg=rustc
2020
else
2121
CompilerSet makeprg=rustc\ \%

ftplugin/rust.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set cpo&vim
1818
" comments, so we'll use that as our default, but make it easy to switch.
1919
" This does not affect indentation at all (I tested it with and without
2020
" leader), merely whether a leader is inserted by default or not.
21-
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader == 1
21+
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0
2222
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
2323
" but without it, */ gets indented one space even if there were no
2424
" leaders. I'm fairly sure that's a Vim bug.
@@ -35,7 +35,7 @@ silent! setlocal formatoptions+=j
3535
" otherwise it's better than nothing.
3636
setlocal smartindent nocindent
3737

38-
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
38+
if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0
3939
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
4040
setlocal textwidth=99
4141
endif
@@ -67,7 +67,7 @@ if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
6767
endif
6868
endif
6969

70-
if has('conceal') && exists('g:rust_conceal')
70+
if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0
7171
let b:rust_set_conceallevel=1
7272
setlocal conceallevel=2
7373
endif

0 commit comments

Comments
 (0)