vim: Add Smart Relative Line Number (#16567)
Closes #16514 Release Notes: - Added Vim: absolute numbering in any mode except `insert` mode --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
26d943287b
commit
9662829810
7 changed files with 96 additions and 6 deletions
|
@ -9,7 +9,9 @@ use crate::{UseSystemClipboard, Vim, VimSettings};
|
|||
use collections::HashMap;
|
||||
use command_palette_hooks::{CommandPaletteFilter, CommandPaletteInterceptor};
|
||||
use editor::{Anchor, ClipboardSelection, Editor};
|
||||
use gpui::{Action, AppContext, BorrowAppContext, ClipboardEntry, ClipboardItem, Global};
|
||||
use gpui::{
|
||||
Action, AppContext, BorrowAppContext, ClipboardEntry, ClipboardItem, Global, View, WeakView,
|
||||
};
|
||||
use language::Point;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use settings::{Settings, SettingsStore};
|
||||
|
@ -160,6 +162,8 @@ pub struct VimGlobals {
|
|||
pub last_yank: Option<SharedString>,
|
||||
pub registers: HashMap<char, Register>,
|
||||
pub recordings: HashMap<char, Vec<ReplayableAction>>,
|
||||
|
||||
pub focused_vim: Option<WeakView<Vim>>,
|
||||
}
|
||||
impl Global for VimGlobals {}
|
||||
|
||||
|
@ -373,6 +377,10 @@ impl VimGlobals {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn focused_vim(&self) -> Option<View<Vim>> {
|
||||
self.focused_vim.as_ref().and_then(|vim| vim.upgrade())
|
||||
}
|
||||
}
|
||||
|
||||
impl Vim {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue