kassio/neoterm

"Can only call this function in an unmodified buffer"

Closed this issue · 2 comments

Since I updated neoterm today, I've started getting this error when I try to use it in a buffer with unsaved changes:

Error detected while processing function neoterm#open[5]..neoterm#new[15]..167:
line    4:
Can only call this function in an unmodified buffer

This happens when I use :Topenor :T some-command.

Is this intended behavior? I definitely find it useful to be able to run one-off commands regardless of the state of my buffer.

This behaviour changed a while ago. :T and :Topen will use the current buffer if you don't pass any vim-mods, like :vert T or :bel T. To set a default mod set g:neoterm_default_mod, like let g:neoterm_default_mod = 'botright'.

Makes sense to me. I have custom keybindings in my vimrc for :T and :Topen anyway, so I've adjusted them accordingly. Works like a charm. Thanks!