Skip to content

Commit ba6dce3

Browse files
authored
Rename function
1 parent f16fe69 commit ba6dce3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

indent/javascript.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ endif
7171
let g:javascript_opfirst = s:line_pre . g:javascript_opfirst
7272
let g:javascript_continuation .= s:line_term
7373

74-
function s:Onescope(lnum,text,add)
74+
function s:OneScope(lnum,text,add)
7575
return a:text =~# '\%(\<else\|\<do\|=>\)' . s:line_term ? 'no b' :
7676
\ ((a:add && a:text =~ s:line_pre . '$' && search('\%' . s:PrevCodeLine(a:lnum - 1) . 'l.)' . s:line_term)) ||
7777
\ cursor(a:lnum, match(a:text, ')' . s:line_term)) > -1) &&
@@ -179,14 +179,14 @@ function GetJavascriptIndent()
179179
let pline = s:StripLine(getline(l:lnum))
180180
call cursor(b:js_cache[1],b:js_cache[2])
181181
let inb = num == 0 || num < l:lnum && ((l:line !~ s:line_pre . ',' && pline !~ ',' . s:line_term) || s:IsBlock())
182-
let switch_offset = num == 0 || s:Onescope(num, s:StripLine(strpart(getline(num),0,b:js_cache[2] - 1)),1) !=# 'switch' ? 0 :
182+
let switch_offset = num == 0 || s:OneScope(num, s:StripLine(strpart(getline(num),0,b:js_cache[2] - 1)),1) !=# 'switch' ? 0 :
183183
\ &cino !~ ':' || !has('float') ? s:sw() :
184184
\ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '.*:[^,]*s' ? s:sw() : 1))
185185

186186
" most significant, find the indent amount
187187
if (inb && (l:line =~# g:javascript_opfirst ||
188188
\ (pline =~# g:javascript_continuation && pline !~# s:expr_case))) ||
189-
\ (num < l:lnum && s:Onescope(l:lnum,pline,0) =~# '\%(for\|each\|if\|let\|no\sb\|w\%(hile\|ith\)\)' &&
189+
\ (num < l:lnum && s:OneScope(l:lnum,pline,0) =~# '\%(for\|each\|if\|let\|no\sb\|w\%(hile\|ith\)\)' &&
190190
\ l:line !~ s:line_pre . '{')
191191
return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset
192192
elseif num > 0

0 commit comments

Comments
 (0)