Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions src/gui/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ void Shell::handleRedraw(const QByteArray& name, const QVariantList& opargs)
} else if (name == "popupmenu_hide") {
m_pum.hide();
} else if (name == "mode_info_set") {
qDebug() << "mode_info_set";
qDebug() << " " << opargs;
handleModeInfoSet(opargs);
} else if (name == "flush") {
// Do Nothing, a notification that nvim is done redrawing.
Expand Down Expand Up @@ -688,25 +690,13 @@ void Shell::handleModeChange(const QVariantList& opargs)
return;
}

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

if (!m_cursor.IsStyleEnabled()) {
if (mode == "insert") {
m_cursor.SetColor({});
m_cursor.SetStyle(Cursor::Shape::Vertical, 25);
m_cursor.SetTimer(0, 0, 0);
}
else if (mode == "replace") {
m_cursor.SetColor({});
m_cursor.SetStyle(Cursor::Shape::Horizontal, 20);
m_cursor.SetTimer(0, 0, 0);
}
else {
m_cursor.SetColor({});
m_cursor.SetStyle(Cursor::Shape::Block, 100);
m_cursor.SetTimer(0, 0, 0);
}
m_cursor.SetColor({});
m_cursor.SetStyle(Cursor::Shape::Block, 100);
m_cursor.SetTimer(0, 0, 0);

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

qDebug() << " cursor_style_enabled:" << cursor_style_enabled;

m_cursor.SetIsStyleEnabled(cursor_style_enabled);
m_modeInfo = mode_info;
}
Expand Down