Skip to content

Commit

Permalink
Tidy: Neural Buffer completion commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelchev committed Dec 28, 2023
1 parent e8295b4 commit f3ebb4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ftplugin/neuralbuf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

call neural#config#Load()

command! -buffer -nargs=0 NeuralRun :call neural#buffer#RunBuffer()
command! -buffer -nargs=0 NeuralCompletion :call neural#buffer#RunBuffer()

nnoremap <silent> <buffer> <Plug>(neural_completion) :NeuralRun<CR>
nnoremap <silent> <buffer> <Plug>(neural_completion) :NeuralCompletion<CR>
" Keybindings of Neural Buffer
execute 'nnoremap ' . g:neural.buffer.completion_key . ' <Plug>(neural_completion)'
Expand Down
2 changes: 0 additions & 2 deletions plugin/neural.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ command! -nargs=? Neural :call neural#Prompt(<q-args>)
command! -nargs=0 NeuralStop :call neural#Stop()
" Create a completion buffer.
command! -nargs=? NeuralBuffer :call neural#buffer#CreateBuffer(<q-args>)
" Run completion on a Neural buffer.
command! -nargs=0 NeuralBufferRun :call neural#buffer#RunBuffer()
" Have Neural explain the visually selected lines.
command! -range NeuralExplain :call neural#explain#SelectedLines()

Expand Down
4 changes: 2 additions & 2 deletions test/vim/test_buffer.vader
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Execute(It should create a neural buffer with arguments):
Given neuralbuf(A Neural buffer):
write a story
Execute(It should correctly run neural):
NeuralRun
NeuralCompletion

AssertEqual
\ [
Expand All @@ -60,6 +60,6 @@ Execute(The correct neural buffer keybinds should be configured):

AssertEqual
\ [
\ 'n <Plug>(neural_completion) *@:NeuralRun<CR>',
\ 'n <Plug>(neural_completion) *@:NeuralCompletion<CR>',
\ ],
\ sort(split(g:output, "\n"))

0 comments on commit f3ebb4d

Please sign in to comment.