diff options
Diffstat (limited to '')
| -rw-r--r-- | plugin/haredoc.vim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugin/haredoc.vim b/plugin/haredoc.vim index 65171fa..d7ff721 100644 --- a/plugin/haredoc.vim +++ b/plugin/haredoc.vim @@ -7,15 +7,14 @@ command -nargs=? Haredoc :call Haredoc(<q-args>) function Haredoc(symbol) let symbol = a:symbol - let popup = 0 - if symbol == '.' - let popup = 1 + let popup = symbol == '.' ? 1 : 0 + if (symbol == '.' || symbol == ',') let oldiskeyword = &iskeyword setlocal iskeyword+=: let symbol = expand('<cword>') let &iskeyword = oldiskeyword endif - if has('terminal') && has('popupwin') && popup == 1 + if popup == 1 && has('popupwin') && has('terminal') let minheight = 1 + system( \ "haredoc -Ftty '"..symbol.."' 2>&1 | wc -l" \ ) @@ -39,8 +38,10 @@ function Haredoc(symbol) \ ) elseif has('terminal') execute 'terminal ++noclose haredoc '..symbol - set nonumber + set nonumber filetype=hare nnoremap <buffer> q :close<CR> + nnoremap <buffer> <nowait> u <C-U> + nnoremap <buffer> <nowait> d <C-D> else execute '!haredoc '..symbol endif |
