forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -15,7 +15,7 @@ def main():
|
||||
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000)
|
||||
placeCursorToLine(editor, "bbb")
|
||||
invokeMenuItem("Edit", "Select All")
|
||||
invokeMenuItem("Edit", "Advanced", "Sort Selected Lines")
|
||||
invokeMenuItem("Edit", "Advanced", "Sort Lines")
|
||||
test.verify(waitFor("str(editor.plainText) == sorted", 2000),
|
||||
"Verify that sorted text\n%s\nmatches the expected text\n%s" % (editor.plainText, sorted))
|
||||
invokeMenuItem('File', 'Revert "unsorted.txt" to Saved')
|
||||
|
||||
Reference in New Issue
Block a user