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

Function slice_to_column

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

Source from the content-addressed store, hash-verified

171}
172
173fn slice_to_column(line: &str, end_col_exclusive: usize) -> String {
174 let end = byte_index_for_column_end(line, end_col_exclusive);
175 if end == 0 {
176 return String::new();
177 }
178 line[..end].to_string()
179}
180
181fn byte_index_for_column_start(line: &str, target_col: usize) -> usize {
182 if target_col == 0 {

Callers 1

get_selected_textMethod · 0.85

Calls 2

newFunction · 0.85

Tested by

no test coverage detected