mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-22 00:20:23 +01:00
0ecefe031e
When using the `editor::actions::CopyAndTrim` action with a multi-line selection in vim's Visual Line mode, pasting would crash Zed. The bug occurred because trimming splits a selection into per-line ranges, creating multiple `editor::ClipboardSelection` entries. However, when `is_entire_line` was true (Visual Line mode), no newline separators were added between these entries in the clipboard text. The paste code then assumed separators existed and read past the end of the text. The fix ensures newline separators are always added between trimmed line ranges, regardless of whether the original selection was in line mode. Closes #46616 Release Notes: - Fixed a crash when pasting after using `editor: copy and trim` in vim's Visual Line mode