Skip to content

Commit

Permalink
When creating a terminal window in neovim, use a new buffer
Browse files Browse the repository at this point in the history
neovim's termopen() replaces the buffer object in the current window
with a terminal, internally, this completely breaks the buffer list.

Repro:
* Create test.vim:

```
vsplit
call termopen( '/bin/bash', { 'cwd': getcwd() } )
call bufload( expand( '<sfile>' ) )
```

Then:
* `nvim -Nu NONE test.vim`
* `:source %`

Error is "Invald buffer name 'test.vim'"

Anyway, the correct thing to do is to create a _new_ buffer before
making it into a terminal (vnew, new) rather than a split of the current
one. This was only working before because the CodeView window never had
any buffer in it and was broken by the change to use the current buffer
when staring debugging.

Fixes puremourning#131
  • Loading branch information
puremourning committed Mar 9, 2020
1 parent 1b74029 commit c1283a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/vimspector/internal/neoterm.vim
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ endfunction
function! vimspector#internal#neoterm#Start( cmd, opts ) abort
if ! get( a:opts, 'curwin', 0 )
if get( a:opts, 'vertical', 0 )
vsplit
vnew
else
split
new
endif
endif

Expand Down

0 comments on commit c1283a2

Please sign in to comment.