ctrl+a: select entire buffer
This commit is contained in:
parent
d5c34ba043
commit
44aa8226c4
|
@ -29,6 +29,7 @@ While editing text:
|
||||||
* `ctrl+z` to undo, `ctrl+y` to redo
|
* `ctrl+z` to undo, `ctrl+y` to redo
|
||||||
* `ctrl+=` to zoom in, `ctrl+-` to zoom out, `ctrl+0` to reset zoom
|
* `ctrl+=` to zoom in, `ctrl+-` to zoom out, `ctrl+0` to reset zoom
|
||||||
* `alt+right`/`alt+left` to jump to the next/previous word, respectively
|
* `alt+right`/`alt+left` to jump to the next/previous word, respectively
|
||||||
|
* mouse drag or `shift` + movement to select text, `ctrl+a` to select all
|
||||||
* `ctrl+e` to modify the sources
|
* `ctrl+e` to modify the sources
|
||||||
|
|
||||||
For shortcuts while editing drawings, consult the online help. Either:
|
For shortcuts while editing drawings, consult the online help. Either:
|
||||||
|
|
5
edit.lua
5
edit.lua
|
@ -301,7 +301,7 @@ function edit.keychord_pressed(State, chord, key)
|
||||||
-- printable character created using shift key => delete selection
|
-- printable character created using shift key => delete selection
|
||||||
-- (we're not creating any ctrl-shift- or alt-shift- combinations using regular/printable keys)
|
-- (we're not creating any ctrl-shift- or alt-shift- combinations using regular/printable keys)
|
||||||
(not App.shift_down() or utf8.len(key) == 1) and
|
(not App.shift_down() or utf8.len(key) == 1) and
|
||||||
chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
|
chord ~= 'C-a' and chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
|
||||||
Text.delete_selection(State, State.left, State.right)
|
Text.delete_selection(State, State.left, State.right)
|
||||||
end
|
end
|
||||||
if State.search_term then
|
if State.search_term then
|
||||||
|
@ -378,6 +378,9 @@ function edit.keychord_pressed(State, chord, key)
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
end
|
end
|
||||||
-- clipboard
|
-- clipboard
|
||||||
|
elseif chord == 'C-a' then
|
||||||
|
State.selection1 = {line=1, pos=1}
|
||||||
|
State.cursor1 = {line=#State.lines, pos=utf8.len(State.lines[#State.lines].data)+1}
|
||||||
elseif chord == 'C-c' then
|
elseif chord == 'C-c' then
|
||||||
local s = Text.selection(State)
|
local s = Text.selection(State)
|
||||||
if s then
|
if s then
|
||||||
|
|
|
@ -311,7 +311,7 @@ function edit.keychord_pressed(State, chord, key)
|
||||||
-- printable character created using shift key => delete selection
|
-- printable character created using shift key => delete selection
|
||||||
-- (we're not creating any ctrl-shift- or alt-shift- combinations using regular/printable keys)
|
-- (we're not creating any ctrl-shift- or alt-shift- combinations using regular/printable keys)
|
||||||
(not App.shift_down() or utf8.len(key) == 1) and
|
(not App.shift_down() or utf8.len(key) == 1) and
|
||||||
chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
|
chord ~= 'C-a' and chord ~= 'C-c' and chord ~= 'C-x' and chord ~= 'backspace' and backspace ~= 'delete' and not App.is_cursor_movement(chord) then
|
||||||
Text.delete_selection(State, State.left, State.right)
|
Text.delete_selection(State, State.left, State.right)
|
||||||
end
|
end
|
||||||
if State.search_term then
|
if State.search_term then
|
||||||
|
@ -417,6 +417,9 @@ function edit.keychord_pressed(State, chord, key)
|
||||||
schedule_save(State)
|
schedule_save(State)
|
||||||
end
|
end
|
||||||
-- clipboard
|
-- clipboard
|
||||||
|
elseif chord == 'C-a' then
|
||||||
|
State.selection1 = {line=1, pos=1}
|
||||||
|
State.cursor1 = {line=#State.lines, pos=utf8.len(State.lines[#State.lines].data)+1, posB=nil}
|
||||||
elseif chord == 'C-c' then
|
elseif chord == 'C-c' then
|
||||||
local s = Text.selection(State)
|
local s = Text.selection(State)
|
||||||
if s then
|
if s then
|
||||||
|
|
Loading…
Reference in New Issue