Skip to content

Commit f15e52f

Browse files
authored
Add Vim Cursor
Vim Cursor is a rectangle with the character inside of it. This commit adds a member function called `setVimCursor()` and `vimCursor()` that sets and retrieves the cursor type the QCodeEditor is presenting. This cursor is only visible when FakeVim is attached to the Editor. The Rectangle is visible when in Normal/Visual mode and a zero width line is visible when in insert mode.
1 parent 97cdee8 commit f15e52f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

include/internal/QCodeEditor.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ class QCodeEditor : public QTextEdit
143143
*/
144144
void clearSquiggle();
145145

146+
/**
147+
* @brief Enables or disables Vim Like cursor
148+
*/
149+
void setVimCursor(bool value);
150+
151+
/**
152+
* @brief Checks if cursor type is Vim Cursor
153+
*/
154+
bool vimCursor() const;
155+
146156
Q_SIGNALS:
147157
/**
148158
* @brief Signal, the font is changed by the wheel event.
@@ -384,10 +394,11 @@ class QCodeEditor : public QTextEdit
384394
bool m_autoIndentation;
385395
bool m_replaceTab;
386396
bool m_extraBottomMargin;
397+
bool m_vimCursor;
387398
QString m_tabReplace;
388399

389400
QList<QTextEdit::ExtraSelection> extra1, extra2, extra_squiggles;
390-
401+
QRect m_cursorRect;
391402
QVector<SquiggleInformation> m_squiggler;
392403

393404
QVector<Parenthesis> m_parentheses;

0 commit comments

Comments
 (0)