1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 22:35:50 +03:00

do not remove yanked text after paste

Этот коммит содержится в:
rhysd
2022-06-18 15:25:24 +09:00
родитель 8ca7cb427c
Коммит 5e7d4daf5b

Просмотреть файл

@@ -842,8 +842,7 @@ impl<'a> TextArea<'a> {
/// assert_eq!(textarea.lines(), [" bbb cccaaa"]);
/// ```
pub fn paste(&mut self) -> bool {
let yank = std::mem::take(&mut self.yank);
self.insert_str(yank)
self.insert_str(self.yank.to_string())
}
/// Move the cursor to the position specified by the [`CursorMove`] parameter. For each kind of cursor moves, see