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

fix(cursor): re-add new VSCodeNotifyRange impl #1358

Merged
merged 8 commits into from
Jul 30, 2023

Conversation

theol0403
Copy link
Member

@theol0403 theol0403 commented Jul 30, 2023

Adds VSCodeNotifyRange but with a more concise and accurate impl. Fixes #1355, fixes #1351, fixes #1345.

Also re-adds VSCodeCommentary and fixes a bug with VSCodeNotify.

@theol0403 theol0403 merged commit 368c58d into vscode-neovim:master Jul 30, 2023
5 checks passed
@theol0403 theol0403 deleted the fix/add-range branch July 30, 2023 03:03
end

function M.notify_range(command, line1, line2, leaveSelection, ...)
return M.notify_extension('range-command', command, 'V', line1, line2, 1, 1, leaveSelection, { ... })
Copy link
Collaborator

@justinmk justinmk Jul 30, 2023

Choose a reason for hiding this comment

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

Seems overwrought to have all these dedicated variants. call() and notify() could cover all these variations with a "kwargs" style dict parameter. That would also simplify the documentation. It also makes the calls, and usage, much easier to understand, instead of having 4+ positional args.

The variadic args ... could just be a list, there's no benefit to variadic args here: they are hard to visually parse vs the non-variadic args.

notify('foo', { arg1, arg2, … } {
  line1=…,  -- if `nil`, treat as non-range command
  line2=…,  -- if `nil`, treat as non-range command
  col1=…,  -- optional, treat as "line" if `nil` but `line1` was provided
  col2=…,  -- optional, treat as "line" if `nil` but `line2` was provided
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants