Skip to content

Commit 03e44f4

Browse files
committed
Clean up some vint lint warnings
1 parent 1272036 commit 03e44f4

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

ftplugin/graphql.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: GraphQL
33
" Maintainer: Jon Parise <[email protected]>
44

5-
if (exists("b:did_ftplugin"))
5+
if (exists('b:did_ftplugin'))
66
finish
77
endif
88
let b:did_ftplugin = 1

indent/graphql.vim

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: GraphQL
33
" Maintainer: Jon Parise <[email protected]>
44

5-
if exists("b:did_indent")
5+
if exists('b:did_indent')
66
finish
77
endif
88
let b:did_indent = 1
@@ -16,16 +16,16 @@ setlocal indentexpr=GetGraphQLIndent()
1616
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O,e
1717

1818
" If our indentation function already exists, we have nothing more to do.
19-
if exists("*GetGraphQLIndent")
19+
if exists('*GetGraphQLIndent')
2020
finish
2121
endif
2222

23-
let s:cpo_save = &cpo
24-
set cpo&vim
23+
let s:cpo_save = &cpoptions
24+
set cpoptions&vim
2525

2626
" Check if the character at lnum:col is inside a string.
2727
function s:InString(lnum, col)
28-
return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'graphqlString'
28+
return synIDattr(synID(a:lnum, a:col, 1), 'name') is# 'graphqlString'
2929
endfunction
3030

3131
function GetGraphQLIndent()
@@ -41,15 +41,15 @@ function GetGraphQLIndent()
4141
" If this line contains just a closing bracket, find its matching opening
4242
" bracket and indent the closing backet to match.
4343
let l:col = matchend(l:line, '^\s*[]})]')
44-
if l:col > 0 && !s:InString(v:lnum, col)
44+
if l:col > 0 && !s:InString(v:lnum, l:col)
4545
let l:bracket = l:line[l:col - 1]
4646
call cursor(v:lnum, l:col)
4747

48-
if l:bracket == '}'
48+
if l:bracket is# '}'
4949
let l:matched = searchpair('{', '', '}', 'bW')
50-
elseif l:bracket == ']'
50+
elseif l:bracket is# ']'
5151
let l:matched = searchpair('\[', '', '\]', 'bW')
52-
elseif l:bracket == ')'
52+
elseif l:bracket is# ')'
5353
let l:matched = searchpair('(', '', ')', 'bW')
5454
else
5555
let l:matched = -1
@@ -65,13 +65,13 @@ function GetGraphQLIndent()
6565

6666
" If the previous line contained an opening bracket, and we are still in it,
6767
" add indent depending on the bracket type.
68-
if getline(l:prevlnum) =~ '[[{(]\s*$'
68+
if getline(l:prevlnum) =~# '[[{(]\s*$'
6969
return indent(l:prevlnum) + shiftwidth()
7070
endif
7171

7272
" Default to the existing indentation level.
7373
return indent(l:prevlnum)
7474
endfunction
7575

76-
let &cpo = s:cpo_save
76+
let &cpoptions = s:cpo_save
7777
unlet s:cpo_save

plugin/graphql.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
" Vim plugin
2+
" Language: GraphQL
3+
" Maintainer: Jon Parise <[email protected]>
4+
"
15
if (!exists('g:graphql_javascript_tags'))
26
let g:graphql_javascript_tags = ['gql', 'graphql', 'Relay.QL']
37
endif

syntax/graphql.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: GraphQL
33
" Maintainer: Jon Parise <[email protected]>
44

5-
if exists("b:current_syntax")
5+
if exists('b:current_syntax')
66
finish
77
endif
88

@@ -60,4 +60,4 @@ hi def link graphqlVariable Identifier
6060

6161
syn sync minlines=500
6262

63-
let b:current_syntax = "graphql"
63+
let b:current_syntax = 'graphql'

0 commit comments

Comments
 (0)