Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideColumn-mode paste now distributes a normalized multi-line clipboard one line per selection when line and selection counts match, while retaining whole-text fallback semantics otherwise. Replacement state and undo/redo bookkeeping use per-selection text lengths to preserve cursor positioning and exact restoration; package metadata is updated for the release. Sequence diagram for column-mode distributed pastesequenceDiagram
participant Clipboard
participant InsertTextUndoCommand
participant ColumnSelections
participant Document
Clipboard->>InsertTextUndoCommand: InsertTextUndoCommand(selections, clipboardText)
InsertTextUndoCommand->>InsertTextUndoCommand: replace("\\r\\n", "\\n")
InsertTextUndoCommand->>InsertTextUndoCommand: split(QLatin1Char('\\n'))
alt line count matches selection count and is greater than one
InsertTextUndoCommand->>ColumnSelections: store lines.at(i) in insertedText
else counts differ or clipboard is single-line
InsertTextUndoCommand->>ColumnSelections: store whole clipboard in insertedText
end
InsertTextUndoCommand->>Document: redo()
loop each column selection
InsertTextUndoCommand->>Document: insertText(insertedText)
InsertTextUndoCommand->>InsertTextUndoCommand: update columnOffset
end
InsertTextUndoCommand->>Document: undo()
loop each column selection
InsertTextUndoCommand->>Document: restore originText using insertedText.size()
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot TAG: 6.5.58 |
f517911 to
2ea1440
Compare
When pasting with column (Alt) selections and the clipboard text has the same number of lines as the selections, insert one clipboard line per selection, matching mainstream editors (VS Code, Sublime, Notepad++). Previously the whole multi-line text was inserted into every selection, duplicating the entire clipboard at each cursor. When the line count differs from the selection count, the previous whole-text-per-selection behavior is kept. 列编辑模式下粘贴与列选区数量一致的多行剪贴板时,按行分发到各列选区, 对齐主流编辑器(VS Code/Sublime/Notepad++)的列模式粘贴语义;此前整段 文本会被原样插入每个选区,导致内容在每个选区整段重复。行数与选区数 不一致时保持原有整段插入行为,撤销/重做按各选区实际插入文本还原。 Log: 修复列编辑粘贴多行剪贴板时内容在每个选区整段重复的问题 Influence: 列编辑模式下粘贴多行剪贴板的行为
f4439ef to
3fbf315
Compare
|
TAG Bot New tag: 6.6.6 |
|
TAG Bot New tag: 6.6.7 |
|
TAG Bot New tag: 6.6.8 |
Problem
When in column-edit mode (Alt + drag, i.e. the
列模式column selection), pasting a multi-line clipboard inserted the whole clipboard text into every column selection, with no per-line distribution logic inInsertTextUndoCommand::redo()(src/editor/inserttextundocommand.cpp).Example: 3 column selections selecting
XYon 3 lines, clipboardAAA\nBBB\nCCC— before this change:9 lines of duplicated content instead of the expected 3 lines distributed one per selection. Single-line clipboard paste was already correct.
Fix
In the multi-selection constructor of
InsertTextUndoCommand, when the clipboard text has the same number of lines as the column selections, store one clipboard line per selection (ColumnReplaceNode::insertedText);redo()/undo()/columnOffsetaccounting then use the per-selection inserted text.\n(dtextedit.cpp).undo()now restores each selection by its actual inserted text size, so undo/redo round-trips stay exact.Verification
Standalone runtime test driving the actual command on a 3-line document with column selections: matched-count paste now yields
aaaaAAAbbbb / ccccBBBdddd / eeeeCCCeeee; CRLF clipboards normalize then distribute; mismatch / single-line / zero-width-cursor cases unchanged; undo restores the original document exactly in all cases. Affected translation unit compiles against Qt6/DTK6.Summary by Sourcery
Fix column-mode multi-line paste to distribute matching clipboard lines across selections while keeping undo and redo behavior exact.
Bug Fixes:
Enhancements: