-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
feat(api): add vscode.to_op
#1570
Conversation
feat: refactor `==` and `gc`, support motions and dotrepeat
@@ -0,0 +1,46 @@ | |||
local vscode = require("vscode-neovim") | |||
|
|||
local k = function(mode, lhs, rhs) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
runtime/lua/vscode-neovim/api.lua
Outdated
@@ -291,14 +291,6 @@ do | |||
local op_func_id = 0 | |||
|
|||
---@see map-operator | |||
--- vim.keymap.set( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
add usage in comment
7e1c8bb
to
d181b15
Compare
feat: refactor
==
andgc
, support motions and dotrepeatclose #1422