From 5885af0005af753fd76f447a40d19d16bd2acad7 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Mon, 11 Sep 2023 13:34:46 -0400 Subject: [PATCH] Clarify doc for TextArea::set_cursor --- cursive-core/src/views/text_area.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cursive-core/src/views/text_area.rs b/cursive-core/src/views/text_area.rs index 1b5ae556..9b101954 100644 --- a/cursive-core/src/views/text_area.rs +++ b/cursive-core/src/views/text_area.rs @@ -97,13 +97,15 @@ impl TextArea { self.cursor } - /// Moves the cursor to the given position. + /// Moves the cursor to the given byte position. /// /// # Panics /// - /// This method panics if `cursor` is not the beginning of a character in + /// This method panics if `cursor` is not the starting byte of a character in /// the content string. pub fn set_cursor(&mut self, cursor: usize) { + // TODO: What to do if we fall inside a multi-codepoint grapheme? + // Move back to the start of the grapheme? self.cursor = cursor; let focus = self.selected_row();