Repository navigation
change: use starting column when using *_current_* apis - #136
Conversation
|
@numToStr Is there any reason the gcc keymap uses -- When using gcc on the second line, this:
vim.cmd [[
echo 'test']]
-- becomes this:
vim.cmd [[
" echo 'test']]
-- instead of this (the original behaviour):
vim.cmd [[
-- echo 'test']]
-- Lua was detected at the end of the line and then the
-- lua commentstring got inserted into the vimscript.I'm not sure if there are maybe some situations you prefer |
@declancm Nope, there is nothing particular reasoning behind using If |
|
@numToStr Yes I tested the PR and it works on empty lines :) . I'm struggling to make the [[v:count == 0 ? (nvim_win_get_cursor(0)[1] == 0 ? (getline('.') == '' ? '<CMD>lua require("Comment.api").call("toggle_current_linewise_op")<CR>g@$' : '<CMD>lua require("Comment.api").call("toggle_current_linewise_op")<CR>g@l') : '<CMD>lua require("Comment.api").call("toggle_current_linewise_op")<CR>g@0') : '<CMD>lua require("Comment.api").call("toggle_linewise_count_op")<CR>g@$']],The api function can be used directly to fix the performance difference but idk if you want that: [[v:count == 0 ? '<CMD>lua require("Comment.api").toggle_current_linewise()<CR>' : '<CMD>lua require("Comment.api").call("toggle_linewise_count_op")<CR>g@$']], |
|
I don't think the added complexity in -- Original
vim.cmd [[
echo 'test']]
-- After
vim.cmd [[
-- echo 'test']]
-- After changing the code
vim.cmd [[
" echo 'test'
]] |
*_current_* api functions
*_current_* api functions*_current_* api functions
*_current_* api functions*_current_* apis
When using an API function on a single line with embedded code, the commentstring detected using treesitter is not correct when using the cursor position. To fix this, I am changing the column position being parsed when vmode is set to nil.