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

Method select_word_at_styled

src/text_input.rs:1086–1094  ·  view source on GitHub ↗

Select word at visual position in styled mode.

(&mut self, visual_pos: usize)

Source from the content-addressed store, hash-verified

1084
1085 /// Select word at visual position in styled mode.
1086 pub fn select_word_at_styled(&mut self, visual_pos: usize) {
1087 let (start, end) = styling::find_word_at_visual(&self.text, visual_pos);
1088 if start != end {
1089 self.selection_anchor = Some(start);
1090 self.cursor_pos = end;
1091 self.snap_to_content_pos();
1092 }
1093 self.reset_blink();
1094 }
1095
1096 /// Snap `cursor_pos` (and `selection_anchor`) so they only land on
1097 /// visible-character boundaries, skipping `}` and empty-content markers.

Callers 1

Calls 3

find_word_at_visualFunction · 0.85
snap_to_content_posMethod · 0.80
reset_blinkMethod · 0.80

Tested by

no test coverage detected