-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Vim Cursor #28
base: master
Are you sure you want to change the base?
Add Vim Cursor #28
Conversation
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.
Best reviewed: commit by commit
Optimal code review plan
|
BTW, you can update the submodule without merging this into master. You can merge this when the FakeVim in CP Editor is finished. |
You can work on FakeVim of CP Editor first. There are too many bugs/problems now, sometimes I can't tell whether it's a problem of the text cursor or a problem of FakeVim itself. |
It will be helpful if you could list them (maybe here, or by opening a PR from fakevim and in that thread). As for bugs, I have found some highlighting issues when selecting block in visual mode. Save, Quit are not implemented correctly. I am thinking of how to behave for |
There are too many. Can't you find any? I can list them when you think everything is OK. |
I have already mentioned some issues that I have found. I am just implementing things haven't tested much. But there are limitations of fakevim, it doesn't supports all vim commands. As for how I added support for fakevim, most of code comes from fakevim example. |
It is "I" in my neovim and all other vim emulation tools that I use, like IdeaVim, VSCode Vim Emulation, Visual Studio Vim Emulation. The block represents the "Replace" mode. So If you press "Ins" it toggles from Insert mode to Replace mode and vice versa. Just as expected, in Replace mode it becomes a block. |
This is from Kate (KDE Notepad++ like an editor). It does not changes the cursor colour to text colour. Rather it generates contrast between the cursor and the text using a Difference Composition mode. auto cp = /* cursor painter */;
cp.setPen(Qt::NoPen);
cp.setBrush(m_syntaxStyle->name() == "Default" ? Qt::white : cursorColor);
cp.setCompositionMode(QPainer::CompositionMode_Difference); |
@ouuan could you please review this PR? |
Vim Cursor is a rectangle with the character inside of it. This commit adds a member function called
setVimCursor()
andvimCursor()
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.