Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
78ce19f8
Commit
78ce19f8
authored
Feb 21, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 21, 2021
Browse files
Try to maintain cursor position on Replace Document Text
parent
04022876
Changes
2
Hide whitespace changes
Inline
Side-by-side
addons/externaltools/defaultexternaltoolsrc
View file @
78ce19f8
[Global]
tools=14
version=
2
version=
1
[Tool 0]
actionName=externaltool_gitcola
...
...
addons/externaltools/externaltoolsplugin.cpp
View file @
78ce19f8
...
...
@@ -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
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment