diff options
author | David Schulz <david.schulz@qt.io> | 2023-10-23 13:38:10 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2023-10-24 07:38:38 +0000 |
commit | 2e93051aaf4aa84eae027e61d0b7c5f347ea9eba (patch) | |
tree | 3b31a5e3fcdd661547e9d3221b7d5e65d1ef3507 /src/plugins/texteditor/texteditoractionhandler.cpp | |
parent | 30ef90c3221ced0241a18f6f0ffe676b4480f900 (diff) |
TextEditor: improve sort selected lines
Try to get a sensible scope when there is no selection when sorting
lines.
Use the indent level of the current block and select all blocks that are
not empty with the same indent level around that block before sorting
the lines.
Change-Id: I68cbd95f95a0cc4425a0339b992225c3946a6858
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditoractionhandler.cpp')
-rw-r--r-- | src/plugins/texteditor/texteditoractionhandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 49b83b8a75..f16c94249b 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -366,8 +366,8 @@ void TextEditorActionHandlerPrivate::createActions() [] (TextEditorWidget *w) { w->lowercaseSelection(); }, true, Tr::tr("Lowercase Selection"), QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+U") : Tr::tr("Alt+U")), G_EDIT_TEXT, advancedEditMenu); - m_modifyingActions << registerAction(SORT_SELECTED_LINES, - [] (TextEditorWidget *w) { w->sortSelectedLines(); }, false, Tr::tr("&Sort Selected Lines"), + m_modifyingActions << registerAction(SORT_LINES, + [] (TextEditorWidget *w) { w->sortLines(); }, false, Tr::tr("&Sort Lines"), QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+Shift+S") : Tr::tr("Alt+Shift+S")), G_EDIT_TEXT, advancedEditMenu); registerAction(FOLD, |