зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-08 00:15:50 +03:00
fix pasting yanked text when it contains multiple lines
Этот коммит содержится в:
@@ -1080,7 +1080,10 @@ impl<'a> TextArea<'a> {
|
|||||||
/// assert_eq!(textarea.lines(), [" bbb cccaaa"]);
|
/// assert_eq!(textarea.lines(), [" bbb cccaaa"]);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn paste(&mut self) -> bool {
|
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
|
/// Move the cursor to the position specified by the [`CursorMove`] parameter. For each kind of cursor moves, see
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user