mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
commands: % as select_all.
This commit is contained in:
parent
f2c2fa0cad
commit
30d1b7098f
@ -284,6 +284,15 @@ pub fn extend_line_down(cx: &mut Context) {
|
||||
doc.set_selection(selection);
|
||||
}
|
||||
|
||||
pub fn select_all(cx: &mut Context) {
|
||||
let doc = cx.doc();
|
||||
|
||||
doc.set_selection(Selection::single(
|
||||
0,
|
||||
doc.text().len_chars().saturating_sub(1),
|
||||
))
|
||||
}
|
||||
|
||||
pub fn select_regex(cx: &mut Context) {
|
||||
let prompt = ui::regex_prompt(cx, "select:".to_string(), |doc, regex| {
|
||||
let text = &doc.text().slice(..);
|
||||
|
@ -164,7 +164,8 @@ pub fn default() -> Keymaps {
|
||||
vec![shift!('S')] => commands::split_selection,
|
||||
vec![key!(';')] => commands::collapse_selection,
|
||||
// TODO should be alt(;)
|
||||
vec![key!('%')] => commands::flip_selections,
|
||||
vec![alt!(';')] => commands::flip_selections,
|
||||
vec![key!('%')] => commands::select_all,
|
||||
vec![key!('x')] => commands::select_line,
|
||||
vec![key!('u')] => commands::undo,
|
||||
vec![shift!('U')] => commands::redo,
|
||||
|
Loading…
Reference in New Issue
Block a user