Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
c93a64c0
Commit
c93a64c0
authored
Apr 29, 2010
by
hjk
Browse files
fakevim: fix cursor positioning in after :!
parent
bfdca886
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
c93a64c0
...
...
@@ -2963,9 +2963,9 @@ bool FakeVimHandler::Private::handleExReadCommand(const QString &line) // :r
QTextStream
ts
(
&
file
);
QString
data
=
ts
.
readAll
();
m_tc
.
insertText
(
data
);
endEditBlock
();
showBlackMessage
(
FakeVimHandler
::
tr
(
"
\"
%1
\"
%2L, %3C"
)
.
arg
(
m_currentFileName
).
arg
(
data
.
count
(
'\n'
)).
arg
(
data
.
size
()));
endEditBlock
();
return
true
;
}
...
...
@@ -2978,9 +2978,9 @@ bool FakeVimHandler::Private::handleExBangCommand(const QString &line) // :!
return
false
;
selectRange
(
beginLine
,
endLine
);
int
targetPosition
=
firstPositionInLine
(
beginLine
);
QString
command
=
cmd
.
mid
(
1
).
trimmed
();
QString
text
=
selectedText
();
removeSelectedText
();
QProcess
proc
;
proc
.
start
(
cmd
.
mid
(
1
));
proc
.
waitForStarted
();
...
...
@@ -2988,9 +2988,12 @@ bool FakeVimHandler::Private::handleExBangCommand(const QString &line) // :!
proc
.
closeWriteChannel
();
proc
.
waitForFinished
();
QString
result
=
QString
::
fromUtf8
(
proc
.
readAllStandardOutput
());
beginEditBlock
(
targetPosition
);
removeSelectedText
();
m_tc
.
insertText
(
result
);
setPosition
(
targetPosition
);
endEditBlock
();
leaveVisualMode
();
setPosition
(
firstPositionInLine
(
beginLine
));
//qDebug() << "FILTER: " << command;
showBlackMessage
(
FakeVimHandler
::
tr
(
"%n lines filtered"
,
0
,
text
.
count
(
'\n'
)));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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