ViEditor: implement I and ^ using SoftHome

This commit is contained in:
Jeremy Soller 2023-10-20 10:26:17 -06:00
parent 4adcbf6784
commit a29eefca5a
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -143,8 +143,7 @@ impl<'a> Edit for ViEditor<'a> {
} }
// Enter insert mode at start of line // Enter insert mode at start of line
'I' => { 'I' => {
//TODO: soft home, skip whitespace self.editor.action(font_system, Action::SoftHome);
self.editor.action(font_system, Action::Home);
self.mode = Mode::Insert; self.mode = Mode::Insert;
} }
// Create line after and enter insert mode // Create line after and enter insert mode
@ -203,8 +202,7 @@ impl<'a> Edit for ViEditor<'a> {
// Go to end of line // Go to end of line
'$' => self.editor.action(font_system, Action::End), '$' => self.editor.action(font_system, Action::End),
// Go to start of line after whitespace // Go to start of line after whitespace
//TODO: implement this '^' => self.editor.action(font_system, Action::SoftHome),
'^' => self.editor.action(font_system, Action::Home),
// Enter command mode // Enter command mode
':' => { ':' => {
self.mode = Mode::Command; self.mode = Mode::Command;