Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
2d7c5de3
Commit
2d7c5de3
authored
Jan 06, 2009
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more status line work
parent
d90dc9e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
src/plugins/fakevim/handler.cpp
src/plugins/fakevim/handler.cpp
+9
-7
No files found.
src/plugins/fakevim/handler.cpp
View file @
2d7c5de3
...
...
@@ -167,7 +167,7 @@ public:
void
moveToNextWord
(
bool
simple
);
void
moveToWordBoundary
(
bool
simple
,
bool
forward
);
void
handleFfTt
(
int
key
);
void
handleCommand
(
const
QString
&
cmd
);
void
handle
Ex
Command
(
const
QString
&
cmd
);
// helper function for handleCommand. return 1 based line index.
int
readLineCode
(
QString
&
cmd
);
...
...
@@ -734,8 +734,7 @@ void FakeVimHandler::Private::handleExMode(int key, const QString &text)
if
(
!
m_commandBuffer
.
isEmpty
())
{
m_commandHistory
.
takeLast
();
m_commandHistory
.
append
(
m_commandBuffer
);
handleCommand
(
m_commandBuffer
);
m_commandBuffer
.
clear
();
handleExCommand
(
m_commandBuffer
);
m_commandCode
=
0
;
}
m_mode
=
CommandMode
;
...
...
@@ -745,7 +744,6 @@ void FakeVimHandler::Private::handleExMode(int key, const QString &text)
m_searchHistory
.
append
(
m_commandBuffer
);
m_lastSearchForward
=
(
m_commandCode
==
'/'
);
search
(
lastSearchString
(),
m_lastSearchForward
);
m_commandBuffer
.
clear
();
m_commandCode
=
0
;
}
m_mode
=
CommandMode
;
...
...
@@ -839,7 +837,7 @@ QTextCursor FakeVimHandler::Private::selectRange(int beginLine, int endLine)
return
tc
;
}
void
FakeVimHandler
::
Private
::
handleCommand
(
const
QString
&
cmd0
)
void
FakeVimHandler
::
Private
::
handle
Ex
Command
(
const
QString
&
cmd0
)
{
QString
cmd
=
cmd0
;
if
(
cmd
.
startsWith
(
"%"
))
...
...
@@ -850,6 +848,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd0)
int
line
=
readLineCode
(
cmd
);
if
(
line
!=
-
1
)
m_mode
=
CommandMode
;
beginLine
=
line
;
if
(
cmd
.
startsWith
(
','
))
{
...
...
@@ -881,6 +880,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd0)
m_registers
[
reg
.
at
(
0
).
unicode
()]
=
tc
.
selection
().
toPlainText
();
tc
.
removeSelectedText
();
}
else
if
(
reWrite
.
indexIn
(
cmd
)
!=
-
1
)
{
// :w
bool
noArgs
=
(
beginLine
==
-
1
);
if
(
beginLine
==
-
1
)
beginLine
=
0
;
if
(
endLine
==
-
1
)
...
...
@@ -891,7 +891,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd0)
fileName
=
m_currentFileName
;
QFile
file
(
fileName
);
bool
exists
=
file
.
exists
();
if
(
exists
&&
!
forced
)
{
if
(
exists
&&
!
forced
&&
!
noArgs
)
{
showMessage
(
"E13: File exists (add ! to override)"
);
}
else
{
file
.
open
(
QIODevice
::
ReadWrite
);
...
...
@@ -905,6 +905,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd0)
m_commandBuffer
=
QString
(
"
\"
%1
\"
%2 %3L, %4C written"
)
.
arg
(
fileName
).
arg
(
exists
?
" "
:
" [New] "
)
.
arg
(
ba
.
count
(
'\n'
)).
arg
(
ba
.
size
());
m_mode
=
CommandMode
;
updateMiniBuffer
();
}
}
else
if
(
cmd
.
startsWith
(
"r "
))
{
// :r
...
...
@@ -916,6 +917,7 @@ void FakeVimHandler::Private::handleCommand(const QString &cmd0)
EDITOR
(
setPlainText
(
data
));
m_commandBuffer
=
QString
(
"
\"
%1
\"
%2L, %3C"
)
.
arg
(
m_currentFileName
).
arg
(
data
.
count
(
'\n'
)).
arg
(
data
.
size
());
m_mode
=
CommandMode
;
updateMiniBuffer
();
}
else
{
showMessage
(
"E492: Not an editor command: "
+
cmd0
);
...
...
@@ -1281,6 +1283,6 @@ void FakeVimHandler::handleCommand(QWidget *widget, const QString &cmd)
{
d
->
m_textedit
=
qobject_cast
<
QTextEdit
*>
(
widget
);
d
->
m_plaintextedit
=
qobject_cast
<
QPlainTextEdit
*>
(
widget
);
d
->
handleCommand
(
cmd
);
d
->
handle
Ex
Command
(
cmd
);
}
Write
Preview
Markdown
is supported
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