Skip to content

Commit 4a911fa

Browse files
committed
Issue 1063: change default guicursor behavior
Currently, when no guicursor value is provided (styling is disabled), we use some default values: block, ver25, or hor25 based on mode. The TUI does not behave the same way, it uses block mode for all cases when guicursor is empty. This change removes the cursor defaults, and applies block mode to all cases where guicursor is empty.
1 parent 2b4cb87 commit 4a911fa

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/gui/shell.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,8 @@ void Shell::handleRedraw(const QByteArray& name, const QVariantList& opargs)
588588
} else if (name == "popupmenu_hide") {
589589
m_pum.hide();
590590
} else if (name == "mode_info_set") {
591+
qDebug() << "mode_info_set";
592+
qDebug() << " " << opargs;
591593
handleModeInfoSet(opargs);
592594
} else if (name == "flush") {
593595
// Do Nothing, a notification that nvim is done redrawing.
@@ -688,25 +690,13 @@ void Shell::handleModeChange(const QVariantList& opargs)
688690
return;
689691
}
690692

691-
const QString mode{ m_nvim->decode(opargs.at(0).toByteArray()) };
693+
//const QString mode{ m_nvim->decode(opargs.at(0).toByteArray()) };
692694
const uint64_t modeIndex{ opargs.at(1).toULongLong() };
693695

694696
if (!m_cursor.IsStyleEnabled()) {
695-
if (mode == "insert") {
696-
m_cursor.SetColor({});
697-
m_cursor.SetStyle(Cursor::Shape::Vertical, 25);
698-
m_cursor.SetTimer(0, 0, 0);
699-
}
700-
else if (mode == "replace") {
701-
m_cursor.SetColor({});
702-
m_cursor.SetStyle(Cursor::Shape::Horizontal, 20);
703-
m_cursor.SetTimer(0, 0, 0);
704-
}
705-
else {
706-
m_cursor.SetColor({});
707-
m_cursor.SetStyle(Cursor::Shape::Block, 100);
708-
m_cursor.SetTimer(0, 0, 0);
709-
}
697+
m_cursor.SetColor({});
698+
m_cursor.SetStyle(Cursor::Shape::Block, 100);
699+
m_cursor.SetTimer(0, 0, 0);
710700

711701
update(neovimCursorRect());
712702
return;
@@ -786,6 +776,8 @@ void Shell::handleModeInfoSet(const QVariantList& opargs)
786776
const bool cursor_style_enabled{ opargs.at(0).toBool() };
787777
const QVariantList mode_info = opargs.at(1).toList();
788778

779+
qDebug() << " cursor_style_enabled:" << cursor_style_enabled;
780+
789781
m_cursor.SetIsStyleEnabled(cursor_style_enabled);
790782
m_modeInfo = mode_info;
791783
}

0 commit comments

Comments
 (0)