Skip to content

Commit 857d6dd

Browse files
committed
Add closing '>' to containing groups
Now paired '<>' close like (), {}, and []. Eg: ```typescript const myFunction = < GenericA, GenericB, GenericC >(a: GenericA, b: GenericB, c:GenericC): GenericA => { return a } ```
1 parent 616186f commit 857d6dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

indent/typescript.vim

+4-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ endfunction
169169
function s:PrevCodeLine(lnum)
170170
let l:n = prevnonblank(a:lnum)
171171
while l:n
172-
if getline(l:n) =~ '^\s*\/[/*]'
172+
if getline(l:n) =~ '^\s*\/[/*]'
173173
if (stridx(getline(l:n),'`') > 0 || getline(l:n-1)[-1:] == '\') &&
174174
\ s:syn_at(l:n,1) =~? s:syng_str
175175
return l:n
@@ -293,8 +293,9 @@ function GetTypescriptIndent()
293293
let l:line = ''
294294
endif
295295

296-
" the containing paren, bracket, or curly. Many hacks for performance
297-
let idx = index([']',')','}'],l:line[0])
296+
" the containing paren, bracket, curly, or closing '>'.
297+
" Many hacks for performance
298+
let idx = index([']',')','}','>'],l:line[0])
298299
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
299300
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
300301
call call('cursor',b:js_cache[1:])

0 commit comments

Comments
 (0)