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
Tobias Hunger
qt-creator
Commits
4af07680
Commit
4af07680
authored
Dec 19, 2008
by
hjk
Browse files
restore overwrite mode hack.
cursor looks better at the end of a line this way...
parent
d4f4f508
Changes
2
Show whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimplugin.cpp
View file @
4af07680
...
@@ -157,7 +157,10 @@ void FakeVimPlugin::installHandler()
...
@@ -157,7 +157,10 @@ void FakeVimPlugin::installHandler()
return
;
return
;
plainTextEdit
->
removeEventFilter
(
m_handler
);
plainTextEdit
->
removeEventFilter
(
m_handler
);
plainTextEdit
->
installEventFilter
(
m_handler
);
plainTextEdit
->
installEventFilter
(
m_handler
);
plainTextEdit
->
setOverwriteMode
(
true
);
QFont
font
=
plainTextEdit
->
font
();
//font.setFamily("Monospace");
m_savedCursorWidth
=
plainTextEdit
->
cursorWidth
();
plainTextEdit
->
setCursorWidth
(
QFontMetrics
(
font
).
width
(
QChar
(
'x'
)));
//QMainWindow mw;
//QMainWindow mw;
connect
(
m_handler
,
SIGNAL
(
commandBufferChanged
(
QString
)),
connect
(
m_handler
,
SIGNAL
(
commandBufferChanged
(
QString
)),
...
@@ -172,7 +175,7 @@ void FakeVimPlugin::removeHandler(QObject *ob)
...
@@ -172,7 +175,7 @@ void FakeVimPlugin::removeHandler(QObject *ob)
QPlainTextEdit
*
plainTextEdit
=
qobject_cast
<
QPlainTextEdit
*>
(
ob
);
QPlainTextEdit
*
plainTextEdit
=
qobject_cast
<
QPlainTextEdit
*>
(
ob
);
if
(
!
plainTextEdit
)
if
(
!
plainTextEdit
)
return
;
return
;
plainTextEdit
->
set
OverwriteMode
(
false
);
plainTextEdit
->
set
CursorWidth
(
m_savedCursorWidth
);
}
}
void
FakeVimPlugin
::
showCommandBuffer
(
const
QString
&
contents
)
void
FakeVimPlugin
::
showCommandBuffer
(
const
QString
&
contents
)
...
...
src/plugins/fakevim/fakevimplugin.h
View file @
4af07680
...
@@ -74,6 +74,7 @@ private:
...
@@ -74,6 +74,7 @@ private:
FakeVimHandler
*
m_handler
;
FakeVimHandler
*
m_handler
;
ExtensionSystem
::
PluginManager
*
m_pm
;
ExtensionSystem
::
PluginManager
*
m_pm
;
QAction
*
m_installHandlerAction
;
QAction
*
m_installHandlerAction
;
int
m_savedCursorWidth
;
};
};
}
// namespace Internal
}
// namespace Internal
...
...
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