Implement ShowHover command to support modal hover keybind (#3158)

Hides the hover popup on any move command.
This commit is contained in:
Kevin King 2024-04-15 00:40:58 -07:00 committed by GitHub
parent 6fa0f4c4b9
commit fc40496e51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,7 @@
- [#2779](https://github.com/lapce/lapce/pull/2779): Fix files detection on fresh git/VCS repository
- [#3031](https://github.com/lapce/lapce/pull/3031): Fix find not receiving inputs when clicked
- [#3142](https://github.com/lapce/lapce/pull/3142): Fix terminal default profile saving incorrectly
- [#3158](https://github.com/lapce/lapce/pull/3158): Fix ShowHover command for showing hover with keybind
## 0.3.1

View File

@ -612,6 +612,7 @@ fn run_move_command(
count: Option<usize>,
mods: Modifiers,
) -> CommandExecuted {
self.common.hover.active.set(false);
if movement.is_jump()
&& movement != &self.editor.last_movement.get_untracked()
{
@ -1046,6 +1047,12 @@ pub fn run_focus_command(
FocusCommand::InlineCompletionInvoke => {
self.update_inline_completion(InlineCompletionTriggerKind::Invoked);
}
FocusCommand::ShowHover => {
let start_offset = self.doc().buffer.with_untracked(|b| {
b.prev_code_boundary(self.cursor().get_untracked().offset())
});
self.update_hover(start_offset);
}
_ => {}
}