Skip to content

fix: fallback action path for todo actions.#17

Closed
boydaihungst wants to merge 1 commit into
YaroSpace:mainfrom
boydaihungst:main
Closed

fix: fallback action path for todo actions.#17
boydaihungst wants to merge 1 commit into
YaroSpace:mainfrom
boydaihungst:main

Conversation

@boydaihungst
Copy link
Copy Markdown

@boydaihungst boydaihungst commented Mar 31, 2026

Sometimes action.ctx.root="", so open and todo will use path="/filename". This will fallback to use action's buffer parent folder.

For example a single example.py file without project will return this action:

{
  _is_condition = <function 1>,
  command = "add_todo__todo_",
  condition = ".*",
  ctx = <1>{
    buf = 16,
    bufname = "/home/huyhoang/a.py",
    col = 0,
    edit = <table 1>,
    filetype = "python",
    line = "",
    range = {
      ["end"] = <2>{
        character = 0,
        line = 0
      },
      rc = { 0, 0, 0, 0 },
      start = <table 2>
    },
    root = "",
    row = 0,
    ts_range = { 1, 0, 1, 0 },
    ts_type = "module",
    win = 1000,
    word = "",
    <metatable> = {
      __index = <function 2>
    }
  },
  desc = "",
  fn = <function 3>,
  group = "Todo",
  name = "Add Todo",
  title = "Add Todo (todo)"
}

Sometime todo action return empty root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant