vim: Disable inline completions if not Insert/Replace mode (#17154)

This is a follow-up to

- https://github.com/zed-industries/zed/pull/17137
- https://github.com/zed-industries/zed/pull/17138 (revert of #17137)

and it does what I originally thought I wouldn't have to do: add another
boolean to `Editor`.

cc @ConradIrwin 
Release Notes:

- Fixed inline completions (Copilot or Supermaven) showing up in Vim's
normal mode.
This commit is contained in:
Thorsten Ball 2024-08-30 14:02:38 +02:00 committed by GitHub
parent 32e96e126f
commit eb7367d8f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -1061,6 +1061,7 @@ impl Vim {
editor.set_input_enabled(vim.editor_input_enabled());
editor.set_autoindent(vim.should_autoindent());
editor.selections.line_mode = matches!(vim.mode, Mode::VisualLine);
editor.set_inline_completions_enabled(matches!(vim.mode, Mode::Insert | Mode::Replace));
});
cx.notify()
}