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

Function slice_by_columns

crates/opencode-tui/src/ui/selection.rs:153–163  ·  view source on GitHub ↗
(line: &str, start_col: usize, end_col_exclusive: usize)

Source from the content-addressed store, hash-verified

151}
152
153fn slice_by_columns(line: &str, start_col: usize, end_col_exclusive: usize) -> String {
154 if start_col >= end_col_exclusive {
155 return String::new();
156 }
157 let start = byte_index_for_column_start(line, start_col);
158 let end = byte_index_for_column_end(line, end_col_exclusive);
159 if start >= end || start >= line.len() {
160 return String::new();
161 }
162 line[start..end].to_string()
163}
164
165fn slice_from_column(line: &str, start_col: usize) -> String {
166 let start = byte_index_for_column_start(line, start_col);

Callers 1

get_selected_textMethod · 0.85

Calls 3

newFunction · 0.85

Tested by

no test coverage detected