vim: Fix clipping when navigating over inlay hints (#22813)
This fixes the issue described in this comment: https://github.com/zed-industries/zed/pull/22439#issuecomment-2563896422 Essentially, we'd clip in the wrong direction when there were multi-line inlay hints. It also fixes inline completions for non-Zeta-providers showing up in normal mode. Release Notes: - N/A
This commit is contained in:
parent
dffdf99228
commit
f9ee28db5e
10 changed files with 76 additions and 13 deletions
|
@ -42,7 +42,7 @@ use fold_map::{FoldMap, FoldSnapshot};
|
|||
use gpui::{
|
||||
AnyElement, Font, HighlightStyle, LineLayout, Model, ModelContext, Pixels, UnderlineStyle,
|
||||
};
|
||||
pub(crate) use inlay_map::Inlay;
|
||||
pub use inlay_map::Inlay;
|
||||
use inlay_map::{InlayMap, InlaySnapshot};
|
||||
pub use inlay_map::{InlayOffset, InlayPoint};
|
||||
use invisibles::{is_invisible, replacement};
|
||||
|
|
|
@ -33,7 +33,7 @@ enum Transform {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct Inlay {
|
||||
pub struct Inlay {
|
||||
pub(crate) id: InlayId,
|
||||
pub position: Anchor,
|
||||
pub text: text::Rope,
|
||||
|
|
|
@ -258,7 +258,7 @@ pub fn render_parsed_markdown(
|
|||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub(crate) enum InlayId {
|
||||
pub enum InlayId {
|
||||
InlineCompletion(usize),
|
||||
Hint(usize),
|
||||
}
|
||||
|
@ -3592,7 +3592,7 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
|
||||
fn splice_inlays(
|
||||
pub fn splice_inlays(
|
||||
&self,
|
||||
to_remove: Vec<InlayId>,
|
||||
to_insert: Vec<Inlay>,
|
||||
|
@ -4883,7 +4883,7 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
|
||||
fn inline_completion_provider(&self) -> Option<Arc<dyn InlineCompletionProviderHandle>> {
|
||||
pub fn inline_completion_provider(&self) -> Option<Arc<dyn InlineCompletionProviderHandle>> {
|
||||
Some(self.inline_completion_provider.as_ref()?.provider.clone())
|
||||
}
|
||||
|
||||
|
|
|
@ -325,6 +325,10 @@ impl InlineCompletionProvider for FakeInlineCompletionProvider {
|
|||
false
|
||||
}
|
||||
|
||||
fn show_completions_in_normal_mode() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn is_enabled(
|
||||
&self,
|
||||
_buffer: &gpui::Model<language::Buffer>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue