Skip to content
dharmx edited this page May 8, 2024 · 11 revisions

A cycle command.

Select the next Mark in the marks list.

local index = 0

cmd("CycleMarkP", function()
  local _, bundle = require("track.util").root_and_bundle()
  if not bundle then return end
  index = math.max(index, math.min(#bundle.views, index)) % #bundle.views + 1
  vim.cmd.SelectMark(index)
end, {})

cmd("CycleMarkN", function()
  local _, bundle = require("track.util").root_and_bundle()
  if not bundle then return end
  index = (index - 2 + #bundle.views) % #bundle.views + 1
  vim.cmd.SelectMark(index)
end, {})
Clone this wiki locally