Allow whitespaces between delimiter key and options

This commit is contained in:
Junegunn Choi
2013-08-13 20:38:23 +09:00
parent 0166077e16
commit aad5012615
5 changed files with 23 additions and 7 deletions

View File

@@ -23,6 +23,8 @@ function! GFM()
\ lang, lang, lang)
endfor
let b:current_syntax='mkd'
syntax sync fromstart
endfunction
```

View File

@@ -389,7 +389,7 @@ function! s:parse_args(args)
" Poor man's option parser
let idx = 0
while 1
let midx = match(args, '{.*}\s*$', idx)
let midx = match(args, '\s*{.*}\s*$', idx)
if midx == -1 | break | endif
let cand = strpart(args, midx)
@@ -399,6 +399,9 @@ function! s:parse_args(args)
let o = eval(cand)
if type(o) == 4
let option = o
if args[midx - 1 : midx] == '\ '
let midx += 1
endif
let args = strpart(args, 0, midx)
break
endif
@@ -471,10 +474,15 @@ function! easy_align#align(just, expr) range
if regexp
let dict = { 'pattern': ch }
else
if ch =~ '^\\\s\+$'
let ch = ' '
elseif ch =~ '^\\\\\s\+$'
let ch = '\'
" Resolving command-line ambiguity
if !empty(a:expr)
" '\ ' => ' '
if ch =~ '^\\\s\+$'
let ch = ' '
" '\\' => '\'
elseif ch =~ '^\\\\\s*$'
let ch = '\'
endif
endif
if !has_key(delimiters, ch)
echon "\rUnknown delimiter key: ". ch

View File

@@ -374,6 +374,11 @@ static std::map<std::string, float>* scores = pointer;
```
Paul<<< McCartney{{{ 1942
George<<< Harrison {{{ 1943
Ringo<<< Starr {{{ 1940
Pete<<< Best {{{ 1941
Paul McCartney 1942
George Harrison 1943
Ringo Starr 1940

View File

@@ -1 +1 @@
4Gvipjyvip
4Gvipjyvip

View File

@@ -16,6 +16,8 @@ function! GFM()
\ lang, lang, lang)
endfor
let b:current_syntax='mkd'
syntax sync fromstart
endfunction
silent! unlet g:easy_align_delimiters
@@ -39,5 +41,4 @@ set buftype=nofile
silent! ScrollPositionHide
call GFM()
syntax sync fromstart