MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / range

Method range

crates/opencode-tui/src/ui/selection.rs:67–78  ·  view source on GitHub ↗

Returns the normalized range: (top-left, bottom-right) in reading order.

(&self)

Source from the content-addressed store, hash-verified

65
66 /// Returns the normalized range: (top-left, bottom-right) in reading order.
67 fn range(&self) -> Option<((u16, u16), (u16, u16))> {
68 match (self.anchor, self.cursor) {
69 (Some(a), Some(b)) => {
70 if a.0 < b.0 || (a.0 == b.0 && a.1 <= b.1) {
71 Some((a, b))
72 } else {
73 Some((b, a))
74 }
75 }
76 _ => None,
77 }
78 }
79
80 /// Test whether a specific cell is inside the selection.
81 pub fn is_selected(&self, row: u16, col: u16) -> bool {

Callers 2

is_selectedMethod · 0.80
get_selected_textMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected