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

Method select_word_at

src/text_input.rs:346–353  ·  view source on GitHub ↗

Select the word at the given character position (for double-click).

(&mut self, char_pos: usize)

Source from the content-addressed store, hash-verified

344
345 /// Select the word at the given character position (for double-click).
346 pub fn select_word_at(&mut self, char_pos: usize) {
347 let (start, end) = find_word_at(&self.text, char_pos);
348 if start != end {
349 self.selection_anchor = Some(start);
350 self.cursor_pos = end;
351 }
352 self.reset_blink();
353 }
354
355 /// Reset blink timer so cursor is immediately visible.
356 pub fn reset_blink(&mut self) {

Callers 1

Calls 2

find_word_atFunction · 0.85
reset_blinkMethod · 0.80

Tested by

no test coverage detected