mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 14:14:24 -05:00
fix(toggle_todo): fixes wrong visual range for ToggleTodo (closes #187)
* Added fix for visual toggle problems * Updated docs
This commit is contained in:
committed by
GitHub
parent
f4f836d4b4
commit
04deff8579
@@ -2723,6 +2723,7 @@ local function ToggleTodo(opts)
|
||||
-- - [ ] by - [x]
|
||||
-- - [x] by -
|
||||
-- enter insert mode if opts.i == true
|
||||
-- if opts.v = true, then look for marks to toggle
|
||||
opts = opts or {}
|
||||
local startline = vim.api.nvim_buf_get_mark(0, "<")[1]
|
||||
local endline = vim.api.nvim_buf_get_mark(0, ">")[1]
|
||||
@@ -2731,7 +2732,7 @@ local function ToggleTodo(opts)
|
||||
-- command from normal mode
|
||||
vim.api.nvim_buf_set_mark(0, "<", 0, 0, {})
|
||||
vim.api.nvim_buf_set_mark(0, ">", 0, 0, {})
|
||||
if startline <= 0 or endline <= 0 then
|
||||
if startline <= 0 or endline <= 0 or opts.v ~= true then
|
||||
startline = cursorlinenr
|
||||
endline = cursorlinenr
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user