Ignore unmatched line on right-justification mode

Unmatched line is NOT ignored on right-justification mode. However this
commit makes such a line ignored when the end of the line is highlighted
as one of the ignored syntax groups (e.g. Comments or Strings)
This commit is contained in:
Junegunn Choi
2013-08-16 02:23:00 +09:00
parent 0fb997d5ab
commit 1e2af43a64
4 changed files with 65 additions and 16 deletions

View File

@@ -251,8 +251,14 @@ function! s:do_align(just, all_tokens, all_delims, fl, ll, fc, lc, pattern, nth,
let delim = delims[nth]
let token = s:rtrim( tokens[nth] )
let token = s:rtrim( strpart(token, 0, len(token) - len(s:rtrim(delim))) )
if empty(delim) && !exists('tokens[nth + 1]') && a:just == 0 && a:ignore_unmatched
continue
if empty(delim) && !exists('tokens[nth + 1]') && a:ignore_unmatched
if a:just == 0
continue
" Do not ignore on right-justification mode, except when the end of the
" line is highlighted as ignored syntax (e.g. comments or strings).
elseif s:highlighted_as(line, a:fc + len(token) - 1, a:ignores)
continue
endif
endif
let indent = len(matchstr(tokens[0], '^\s\+'))