mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-03 08:54:04 +00:00
Rename add_cursor_{above,below}
to add_selection_{above, below}
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
b6449b3809
commit
3fe64400c6
1 changed files with 15 additions and 9 deletions
|
@ -153,12 +153,12 @@ pub fn init(app: &mut MutableAppContext) {
|
||||||
),
|
),
|
||||||
Binding::new(
|
Binding::new(
|
||||||
"ctrl-shift-up",
|
"ctrl-shift-up",
|
||||||
"buffer:add_cursor_above",
|
"buffer:add_selection_above",
|
||||||
Some("BufferView"),
|
Some("BufferView"),
|
||||||
),
|
),
|
||||||
Binding::new(
|
Binding::new(
|
||||||
"ctrl-shift-down",
|
"ctrl-shift-down",
|
||||||
"buffer:add_cursor_below",
|
"buffer:add_selection_below",
|
||||||
Some("BufferView"),
|
Some("BufferView"),
|
||||||
),
|
),
|
||||||
Binding::new("pageup", "buffer:page_up", Some("BufferView")),
|
Binding::new("pageup", "buffer:page_up", Some("BufferView")),
|
||||||
|
@ -257,8 +257,14 @@ pub fn init(app: &mut MutableAppContext) {
|
||||||
"buffer:split_selection_into_lines",
|
"buffer:split_selection_into_lines",
|
||||||
BufferView::split_selection_into_lines,
|
BufferView::split_selection_into_lines,
|
||||||
);
|
);
|
||||||
app.add_action("buffer:add_cursor_above", BufferView::add_cursor_above);
|
app.add_action(
|
||||||
app.add_action("buffer:add_cursor_below", BufferView::add_cursor_below);
|
"buffer:add_selection_above",
|
||||||
|
BufferView::add_selection_above,
|
||||||
|
);
|
||||||
|
app.add_action(
|
||||||
|
"buffer:add_selection_below",
|
||||||
|
BufferView::add_selection_below,
|
||||||
|
);
|
||||||
app.add_action("buffer:page_up", BufferView::page_up);
|
app.add_action("buffer:page_up", BufferView::page_up);
|
||||||
app.add_action("buffer:page_down", BufferView::page_down);
|
app.add_action("buffer:page_down", BufferView::page_down);
|
||||||
app.add_action("buffer:fold", BufferView::fold);
|
app.add_action("buffer:fold", BufferView::fold);
|
||||||
|
@ -1780,15 +1786,15 @@ impl BufferView {
|
||||||
self.update_selections(new_selections, true, ctx);
|
self.update_selections(new_selections, true, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_cursor_above(&mut self, _: &(), ctx: &mut ViewContext<Self>) {
|
pub fn add_selection_above(&mut self, _: &(), ctx: &mut ViewContext<Self>) {
|
||||||
self.add_cursor(true, ctx);
|
self.add_selection(true, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_cursor_below(&mut self, _: &(), ctx: &mut ViewContext<Self>) {
|
pub fn add_selection_below(&mut self, _: &(), ctx: &mut ViewContext<Self>) {
|
||||||
self.add_cursor(false, ctx);
|
self.add_selection(false, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_cursor(&mut self, above: bool, ctx: &mut ViewContext<Self>) {
|
pub fn add_selection(&mut self, above: bool, ctx: &mut ViewContext<Self>) {
|
||||||
use super::RangeExt;
|
use super::RangeExt;
|
||||||
|
|
||||||
let app = ctx.as_ref();
|
let app = ctx.as_ref();
|
||||||
|
|
Loading…
Reference in a new issue