vim: Add vim command filename autocomplete (#36332)
Release Notes: - Adds filename autocomplete for vim commands: - write - edit - split - vsplit - tabedit - tabnew - Makes command palette interceptor async <img width="1382" height="634" alt="image" src="https://github.com/user-attachments/assets/e7bf01c5-e9cd-4a7d-b38c-12fc3df5069f" /> --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ use crate::{ToggleMarksView, ToggleRegistersView, UseSystemClipboard, Vim, VimAd
|
||||
use crate::{motion::Motion, object::Object};
|
||||
use anyhow::Result;
|
||||
use collections::HashMap;
|
||||
use command_palette_hooks::{CommandPaletteFilter, CommandPaletteInterceptor};
|
||||
use command_palette_hooks::{CommandPaletteFilter, GlobalCommandPaletteInterceptor};
|
||||
use db::{
|
||||
sqlez::{domain::Domain, thread_safe_connection::ThreadSafeConnection},
|
||||
sqlez_macros::sql,
|
||||
@@ -718,9 +718,7 @@ impl VimGlobals {
|
||||
CommandPaletteFilter::update_global(cx, |filter, _| {
|
||||
filter.show_namespace(Vim::NAMESPACE);
|
||||
});
|
||||
CommandPaletteInterceptor::update_global(cx, |interceptor, _| {
|
||||
interceptor.set(Box::new(command_interceptor));
|
||||
});
|
||||
GlobalCommandPaletteInterceptor::set(cx, command_interceptor);
|
||||
for window in cx.windows() {
|
||||
if let Some(workspace) = window.downcast::<Workspace>() {
|
||||
workspace
|
||||
@@ -735,9 +733,7 @@ impl VimGlobals {
|
||||
} else {
|
||||
KeyBinding::set_vim_mode(cx, false);
|
||||
*Vim::globals(cx) = VimGlobals::default();
|
||||
CommandPaletteInterceptor::update_global(cx, |interceptor, _| {
|
||||
interceptor.clear();
|
||||
});
|
||||
GlobalCommandPaletteInterceptor::clear(cx);
|
||||
CommandPaletteFilter::update_global(cx, |filter, _| {
|
||||
filter.hide_namespace(Vim::NAMESPACE);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user