MCPcopy Create free account
hub / github.com/GCWing/BitFun / move_cursor_down

Method move_cursor_down

src/apps/cli/src/ui/text_input.rs:152–162  ·  view source on GitHub ↗

Move cursor down one logical line. Returns false if already on last line.

(&mut self)

Source from the content-addressed store, hash-verified

150
151 /// Move cursor down one logical line. Returns false if already on last line.
152 pub fn move_cursor_down(&mut self) -> bool {
153 let (line, col, _) = self.cursor_line_col();
154 let counts = self.input_line_char_counts();
155 if line >= counts.len() - 1 {
156 return false;
157 }
158 let next_len = counts[line + 1];
159 let target_col = col.min(next_len);
160 self.cursor = counts[..line + 1].iter().sum::<usize>() + (line + 1) + target_col;
161 true
162 }
163
164 pub fn set_cursor_home(&mut self) {
165 let (_, _, line_start) = self.cursor_line_col();

Callers 1

handle_keyMethod · 0.80

Calls 4

cursor_line_colMethod · 0.80
iterMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected