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

fix pasting yanked text when it contains multiple lines

Этот коммит содержится в:
rhysd
2023-11-03 02:39:58 +09:00
родитель b6056484d8
Коммит 217c5079f0

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

@@ -1080,7 +1080,10 @@ impl<'a> TextArea<'a> {
/// assert_eq!(textarea.lines(), [" bbb cccaaa"]);
/// ```
pub fn paste(&mut self) -> bool {
self.insert_piece(self.yank.to_string())
match self.yank.clone() {
YankText::Piece(s) => self.insert_piece(s),
YankText::Chunk(c) => self.insert_chunk(c),
}
}
/// Move the cursor to the position specified by the [`CursorMove`] parameter. For each kind of cursor moves, see