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
f6d4680f
Commit
f6d4680f
authored
Feb 08, 2010
by
hjk
Browse files
fakevim: make ':r' undoable and behave more vim-ish
parent
e500075b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
f6d4680f
...
...
@@ -2354,14 +2354,19 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
(
"Cannot open file '%1' for reading"
).
arg
(
fileName
));
}
}
else
if
(
cmd
.
startsWith
(
QLatin1String
(
"r "
)))
{
// :r
beginEditBlock
();
moveToStartOfLine
();
setTargetColumn
();
moveDown
();
m_currentFileName
=
cmd
.
mid
(
2
);
QFile
file
(
m_currentFileName
);
file
.
open
(
QIODevice
::
ReadOnly
);
QTextStream
ts
(
&
file
);
QString
data
=
ts
.
readAll
();
EDITOR
(
setPlain
Text
(
data
)
)
;
m_tc
.
insert
Text
(
data
);
showBlackMessage
(
FakeVimHandler
::
tr
(
"
\"
%1
\"
%2L, %3C"
)
.
arg
(
m_currentFileName
).
arg
(
data
.
count
(
'\n'
)).
arg
(
data
.
size
()));
endEditBlock
();
}
else
if
(
cmd
.
startsWith
(
QLatin1Char
(
'!'
)))
{
selectRange
(
beginLine
,
endLine
);
QString
command
=
cmd
.
mid
(
1
).
trimmed
();
...
...
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