line wrapping is now working properly well

This commit is contained in:
Priec
2025-08-18 09:44:53 +02:00
parent 6588f310f2
commit 5efee3f044
4 changed files with 283 additions and 23 deletions

View File

@@ -243,6 +243,17 @@ fn handle_key_press(
(KeyCode::Delete, _) => editor.delete_char_forward(),
(KeyCode::Backspace, _) => editor.delete_char_backward(),
(KeyCode::F(1), _) => {
// Switch to indicator mode
editor.textarea.use_overflow_indicator('$');
editor.set_debug_message("Overflow: indicator '$' (wrap OFF)".to_string());
}
(KeyCode::F(2), _) => {
// Switch to wrap mode
editor.textarea.use_wrap();
editor.set_debug_message("Overflow: wrap ON".to_string());
}
// Debug/info
(KeyCode::Char('?'), _) => {
editor.set_debug_message(format!(

View File

@@ -77,6 +77,7 @@ Press ? for help, F1/F2 for manual cursor control demo.";
let mut textarea = TextAreaState::from_text(initial_text);
textarea.set_placeholder("Start typing...");
textarea.use_wrap();
Self {
textarea,