MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / move_home

Method move_home

src/text_input.rs:233–244  ·  view source on GitHub ↗

Move cursor to start of line.

(&mut self, shift: bool)

Source from the content-addressed store, hash-verified

231
232 /// Move cursor to start of line.
233 pub fn move_home(&mut self, shift: bool) {
234 if shift && self.selection_anchor.is_none() {
235 self.selection_anchor = Some(self.cursor_pos);
236 }
237 self.cursor_pos = 0;
238 if !shift {
239 self.selection_anchor = None;
240 } else if self.selection_anchor == Some(0) {
241 self.selection_anchor = None;
242 }
243 self.reset_blink();
244 }
245
246 /// Move cursor to end of line.
247 pub fn move_end(&mut self, shift: bool) {

Callers 1

Calls 1

reset_blinkMethod · 0.80

Tested by

no test coverage detected