Make OpenKeyContextView open to the right (#24452)
Match the behavior of OpenSyntaxTreeView logs and OpenLanguageServerLogs Release Notes: - Make `debug::OpenSyntaxTreeView` automatically open in split to the right
This commit is contained in:
parent
8114d17cba
commit
c484374b2f
1 changed files with 7 additions and 3 deletions
|
@ -11,8 +11,7 @@ use ui::{
|
||||||
Window,
|
Window,
|
||||||
};
|
};
|
||||||
use ui::{Button, ButtonStyle};
|
use ui::{Button, ButtonStyle};
|
||||||
use workspace::Item;
|
use workspace::{Item, SplitDirection, Workspace};
|
||||||
use workspace::Workspace;
|
|
||||||
|
|
||||||
actions!(debug, [OpenKeyContextView]);
|
actions!(debug, [OpenKeyContextView]);
|
||||||
|
|
||||||
|
@ -20,7 +19,12 @@ pub fn init(cx: &mut App) {
|
||||||
cx.observe_new(|workspace: &mut Workspace, _, _| {
|
cx.observe_new(|workspace: &mut Workspace, _, _| {
|
||||||
workspace.register_action(|workspace, _: &OpenKeyContextView, window, cx| {
|
workspace.register_action(|workspace, _: &OpenKeyContextView, window, cx| {
|
||||||
let key_context_view = cx.new(|cx| KeyContextView::new(window, cx));
|
let key_context_view = cx.new(|cx| KeyContextView::new(window, cx));
|
||||||
workspace.add_item_to_active_pane(Box::new(key_context_view), None, true, window, cx)
|
workspace.split_item(
|
||||||
|
SplitDirection::Right,
|
||||||
|
Box::new(key_context_view),
|
||||||
|
window,
|
||||||
|
cx,
|
||||||
|
)
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue