mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
ESC to exit edit mode with Vim disabled
This commit is contained in:
parent
28e4818c26
commit
eb25aec5b5
@ -665,8 +665,9 @@ void VMdEditor::clearUnusedImages()
|
|||||||
|
|
||||||
void VMdEditor::keyPressEvent(QKeyEvent *p_event)
|
void VMdEditor::keyPressEvent(QKeyEvent *p_event)
|
||||||
{
|
{
|
||||||
|
int key = p_event->key();
|
||||||
int modifiers = p_event->modifiers();
|
int modifiers = p_event->modifiers();
|
||||||
switch (p_event->key()) {
|
switch (key) {
|
||||||
case Qt::Key_Minus:
|
case Qt::Key_Minus:
|
||||||
case Qt::Key_Underscore:
|
case Qt::Key_Underscore:
|
||||||
// Zoom out.
|
// Zoom out.
|
||||||
@ -709,6 +710,12 @@ void VMdEditor::keyPressEvent(QKeyEvent *p_event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Esc to exit edit mode when Vim is disabled.
|
||||||
|
if (key == Qt::Key_Escape) {
|
||||||
|
emit m_object->discardAndRead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
VTextEdit::keyPressEvent(p_event);
|
VTextEdit::keyPressEvent(p_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user