MCPcopy Create free account
hub / github.com/Eeive/Evcode-ide / selection_range

Method selection_range

src/editor/buffer.rs:91–102  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

89 }
90
91 pub fn selection_range(&self) -> Option<((usize, usize), (usize, usize))> {
92 let anchor = self.selection_anchor?;
93 let cursor = self.cursor;
94 (anchor != cursor).then(|| {
95 let (start, end) = if (anchor.line, anchor.column) <= (cursor.line, cursor.column) {
96 (anchor, cursor)
97 } else {
98 (cursor, anchor)
99 };
100 (start.line_col(), end.line_col())
101 })
102 }
103
104 pub fn start_selection(&mut self) {
105 if self.selection_anchor.is_none() {

Callers 3

selected_textMethod · 0.80
take_selectionMethod · 0.80
drawFunction · 0.80

Calls 1

line_colMethod · 0.80

Tested by

no test coverage detected