terminal: Don't enter terminal mode from :normal

Ref: https://github.com/junegunn/fzf.vim/issues/8#issuecomment-139209765
This commit is contained in:
Thiago de Arruda
2015-09-10 09:22:59 -03:00
parent b7dab423ef
commit 1b1716477c
3 changed files with 24 additions and 2 deletions

View File

@@ -254,7 +254,16 @@ edit (
)
{
if (curbuf->terminal) {
terminal_enter();
if (ex_normal_busy) {
// don't enter terminal mode from `ex_normal`, which can result in all
// kinds of havoc(such as terminal mode recursiveness). Instead, set a
// flag that allow us to force-set the value of `restart_edit` before
// `ex_normal` returns
restart_edit = 'i';
force_restart_edit = true;
} else {
terminal_enter();
}
return false;
}