vim: Allow : in empty panes and screen shares (#10171)
Release Notes: - vim: Fixed `:` when no files are open
This commit is contained in:
@@ -546,6 +546,12 @@
|
|||||||
"escape": "buffer_search::Dismiss"
|
"escape": "buffer_search::Dismiss"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"context": "EmptyPane || SharedScreen",
|
||||||
|
"bindings": {
|
||||||
|
":": "command_palette::Toggle"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// netrw compatibility
|
// netrw compatibility
|
||||||
"context": "ProjectPanel && not_editing",
|
"context": "ProjectPanel && not_editing",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use futures::{stream::FuturesUnordered, StreamExt};
|
|||||||
use gpui::{
|
use gpui::{
|
||||||
actions, anchored, deferred, impl_actions, prelude::*, Action, AnchorCorner, AnyElement,
|
actions, anchored, deferred, impl_actions, prelude::*, Action, AnchorCorner, AnyElement,
|
||||||
AppContext, AsyncWindowContext, ClickEvent, DismissEvent, Div, DragMoveEvent, EntityId,
|
AppContext, AsyncWindowContext, ClickEvent, DismissEvent, Div, DragMoveEvent, EntityId,
|
||||||
EventEmitter, ExternalPaths, FocusHandle, FocusableView, Model, MouseButton,
|
EventEmitter, ExternalPaths, FocusHandle, FocusableView, KeyContext, Model, MouseButton,
|
||||||
NavigationDirection, Pixels, Point, PromptLevel, Render, ScrollHandle, Subscription, Task,
|
NavigationDirection, Pixels, Point, PromptLevel, Render, ScrollHandle, Subscription, Task,
|
||||||
View, ViewContext, VisualContext, WeakFocusHandle, WeakView, WindowContext,
|
View, ViewContext, VisualContext, WeakFocusHandle, WeakView, WindowContext,
|
||||||
};
|
};
|
||||||
@@ -1733,8 +1733,14 @@ impl FocusableView for Pane {
|
|||||||
|
|
||||||
impl Render for Pane {
|
impl Render for Pane {
|
||||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||||
|
let mut key_context = KeyContext::default();
|
||||||
|
key_context.add("Pane");
|
||||||
|
if self.active_item().is_none() {
|
||||||
|
key_context.add("EmptyPane");
|
||||||
|
}
|
||||||
|
|
||||||
v_flex()
|
v_flex()
|
||||||
.key_context("Pane")
|
.key_context(key_context)
|
||||||
.track_focus(&self.focus_handle)
|
.track_focus(&self.focus_handle)
|
||||||
.size_full()
|
.size_full()
|
||||||
.flex_none()
|
.flex_none()
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ impl Render for SharedScreen {
|
|||||||
div()
|
div()
|
||||||
.bg(cx.theme().colors().editor_background)
|
.bg(cx.theme().colors().editor_background)
|
||||||
.track_focus(&self.focus)
|
.track_focus(&self.focus)
|
||||||
|
.key_context("SharedScreen")
|
||||||
.size_full()
|
.size_full()
|
||||||
.children(
|
.children(
|
||||||
self.frame
|
self.frame
|
||||||
|
|||||||
Reference in New Issue
Block a user