Skip to content

Commit

Permalink
Fix some issues with hanging attribute indentation
Browse files Browse the repository at this point in the history
Seems like the "current line" doesn't really have any syntax when it's
empty, so pressing <enter> doesn't work, even if a manual reindent does.

Instead, we check the syntax of the line above.
  • Loading branch information
AndrewRadev committed Mar 1, 2017
1 parent bb1de1c commit e340ee2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion indent/handlebars.vim
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ function! GetHandlebarsIndent(...)
" tag is on a separate line

" check for a hanging attribute
if synIDattr(synID(v:lnum, 1, 1), "name") =~ 'mustache\%(Inside\|Section\)'
let last_plnum_col = col([plnum, '$']) - 1
if synIDattr(synID(plnum, last_plnum_col, 1), "name") =~ '^mustache'
let hanging_attribute_pattern = '{{\#\=\%(\k\|[/-]\)\+\s\+\zs\k\+='
let just_component_pattern = '^\s*{{\%(\k\|[/-]\)\+\s*$'

Expand Down

0 comments on commit e340ee2

Please sign in to comment.