Skip to content

Commit

Permalink
add some key bindings in prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
gosho-kazuya committed Jul 18, 2017
1 parent f70031e commit 96b7cf4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
doc/tags
4 changes: 3 additions & 1 deletion autoload/FlyGrep.vim
Expand Up @@ -37,7 +37,7 @@ function! s:flygrep(expr) abort
redrawstatus
return
endif
try
try
syn clear FileNames
catch
endtr
Expand Down Expand Up @@ -181,8 +181,10 @@ endfunction
let s:MPT._function_key = {
\ "\<Tab>" : function('s:next_item'),
\ "\<ScrollWheelDown>" : function('s:next_item'),
\ "\<C-n>" : function('s:next_item'),
\ "\<S-tab>" : function('s:previous_item'),
\ "\<ScrollWheelUp>" : function('s:previous_item'),
\ "\<C-p>" : function('s:previous_item'),
\ "\<Return>" : function('s:open_item'),
\ "\<LeftMouse>" : function('s:move_cursor'),
\ "\<2-LeftMouse>" : function('s:double_click'),
Expand Down
8 changes: 4 additions & 4 deletions autoload/SpaceVim/api/prompt.vim
Expand Up @@ -43,13 +43,13 @@ func! s:self._handle_input() abort
call call(self._function_key[char], [])
continue
endif
if char ==# "\<Right>" || char == 6
if char ==# "\<Right>" || char == 6 || char ==# "\<C-f>"
let self._prompt.begin = self._prompt.begin . self._prompt.cursor
let self._prompt.cursor = matchstr(self._prompt.end, '^.')
let self._prompt.end = substitute(self._prompt.end, '^.', '', 'g')
call self._build_prompt()
continue
elseif char ==# "\<Left>" || char == 2
elseif char ==# "\<Left>" || char == 2 || char ==# "\<C-b>"
if self._prompt.begin !=# ''
let self._prompt.end = self._prompt.cursor . self._prompt.end
let self._prompt.cursor = matchstr(self._prompt.begin, '.$')
Expand Down Expand Up @@ -79,10 +79,10 @@ func! s:self._handle_input() abort
let self._prompt.cursor = ''
let self._prompt.end = ''
call self._build_prompt()
elseif char ==# "\<bs>"
elseif char ==# "\<bs>" || char ==# "\<C-h>"
let self._prompt.begin = substitute(self._prompt.begin,'.$','','g')
call self._build_prompt()
elseif char == self._keys.close
elseif char == self._keys.close || char ==# "\<C-c>"
call self.close()
break
elseif char ==# "\<FocusLost>" || char ==# "\<FocusGained>" || char2nr(char) == 128
Expand Down

0 comments on commit 96b7cf4

Please sign in to comment.