Skip to content
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

feat(api): add vscode.to_op #1570

Merged
merged 5 commits into from
Oct 27, 2023

Conversation

xiyaowong
Copy link
Collaborator

feat: refactor == and gc, support motions and dotrepeat

close #1422

feat: refactor `==` and `gc`, support motions and dotrepeat
@@ -0,0 +1,46 @@
local vscode = require("vscode-neovim")

local k = function(mode, lhs, rhs)
Copy link
Member

@theol0403 theol0403 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this helper provides enough value to keep users from seeing the full mapping details in one line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is concise and common

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just if users are supposed to use the file as a reference for the API, it should be simple and straightforward instead of needing to also copy a helper. It is nice if users can just copy/paste directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most common operation, and users can see the most critical "expr" parameter at a glance. There is no misleading anywhere. A user who just wants to copy and paste will not look at these files at all.

@@ -291,14 +291,6 @@ do
local op_func_id = 0

---@see map-operator
--- vim.keymap.set(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this usage is good to have somewhere, maybe the readme?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what to write.. This function is simply encapsulated, and the details are in the vim document.
Maybe more examples can be added later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you wrote was good

@theol0403 theol0403 merged commit c9d600f into vscode-neovim:master Oct 27, 2023
8 checks passed
@xiyaowong xiyaowong deleted the feat/operator-helper branch October 28, 2023 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: make vscode commands dot-repeatable and work in operator-pending mode
2 participants