Skip to content

Commit 8bd60a3

Browse files
committed
Add const and let to indent file
These keywords are part of ES6 and are used like the `var` keyword. This commit makes the indentation file treat them the same as `var`.
1 parent 6cad2d9 commit 8bd60a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

indent/javascript.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set cpo&vim
2929
" 1. Variables {{{1
3030
" ============
3131

32-
let s:js_keywords = '^\s*\(break\|case\|catch\|continue\|debugger\|default\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)'
32+
let s:js_keywords = '^\s*\(break\|case\|catch\|const\|continue\|debugger\|default\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|let\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)'
3333

3434
" Regex of syntax group names that are or delimit string or are comments.
3535
let s:syng_strcom = 'string\|regex\|comment\c'
@@ -60,7 +60,7 @@ let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
6060
" Regex that defines blocks.
6161
let s:block_regex = '\%([{[]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
6262

63-
let s:var_stmt = '^\s*var'
63+
let s:var_stmt = '^\s*(const\|let\|var)'
6464

6565
let s:comma_first = '^\s*,'
6666
let s:comma_last = ',\s*$'

0 commit comments

Comments
 (0)