forked from qt-creator/qt-creator
		
	Removed the "Join Lines Up" action
It was a bit confusing, since it reversed the order of the lines. When this would be fixed, the added value of this action is very small, since you can then also simply move your cursor one up before joining the lines.
This commit is contained in:
		| @@ -877,39 +877,24 @@ void BaseTextEditor::copyLineUpDown(bool up) | ||||
|     setTextCursor(move); | ||||
| } | ||||
|  | ||||
| void BaseTextEditor::joinLineUp() | ||||
| { | ||||
|     joinLineUpDown(true); | ||||
| } | ||||
|  | ||||
| void BaseTextEditor::joinLineDown() | ||||
| { | ||||
|     joinLineUpDown(false); | ||||
| } | ||||
|  | ||||
| void BaseTextEditor::joinLineUpDown(bool up) | ||||
| void BaseTextEditor::joinLines() | ||||
| { | ||||
|     QTextCursor move = textCursor(); | ||||
|     move.beginEditBlock(); | ||||
|  | ||||
|     if(up) | ||||
|         move.movePosition(QTextCursor::Up); | ||||
|     else | ||||
|         move.movePosition(QTextCursor::Down); | ||||
|  | ||||
|     move.movePosition(QTextCursor::Down); | ||||
|     move.movePosition(QTextCursor::StartOfBlock); | ||||
|     move.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); | ||||
|     QString cutLine = move.selectedText(); | ||||
|  | ||||
|     // collapse trailing whitespaces to one or insert whitespace | ||||
|     cutLine.replace(QRegExp("^\\s*"), " "); | ||||
|     move.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor); | ||||
|     move.removeSelectedText(); | ||||
|     move.clearSelection(); | ||||
|  | ||||
|     if(!up) | ||||
|         move.movePosition(QTextCursor::Up); | ||||
|  | ||||
|     move.movePosition(QTextCursor::Up); | ||||
|     move.movePosition(QTextCursor::EndOfBlock); | ||||
|  | ||||
|     move.insertText(cutLine); | ||||
|     move.endEditBlock(); | ||||
|     setTextCursor(move); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user