Commit 78ce19f8 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Try to maintain cursor position on Replace Document Text

parent 04022876
[Global]
tools=14
version=2
version=1
[Tool 0]
actionName=externaltool_gitcola
......
......@@ -212,8 +212,10 @@ void KateExternalToolsPlugin::handleToolFinished(KateToolRunner *runner, int exi
}
case KateExternalTool::OutputMode::ReplaceCurrentDocument: {
KTextEditor::Document::EditingTransaction transaction(view->document());
auto cursor = view->cursorPosition();
view->document()->clear();
view->insertText(runner->outputData());
view->setCursorPosition(cursor);
break;
}
case KateExternalTool::OutputMode::AppendToCurrentDocument: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment