fixed new line addition in text box
@@ -309,7 +309,6 @@ impl TextBox {
/// Inserts given character at current caret position.
fn insert_char(&mut self, c: char, ui: &UserInterface) {
- if !c.is_control() {
let position = self.get_absolute_position(self.caret_position).unwrap_or(0);
self.formatted_text
.borrow_mut()
@@ -322,7 +321,6 @@ impl TextBox {
self.formatted_text.borrow().text(),
));
}
- }
fn insert_str(&mut self, str: &str, ui: &UserInterface) {
let position = self.get_absolute_position(self.caret_position).unwrap_or(0);
@@ -703,9 +701,11 @@ impl Control for TextBox {
self.remove_range(ui, range);
self.selection_range = None;
}
+ if !symbol.is_control() {
self.insert_char(symbol, ui);
}
}
+ }
WidgetMessage::KeyDown(code) => {
match code {
KeyCode::Up => {
