nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.04k stars 134 forks source link

Trying to append to an existing todo from the capture buffer throws an error #27

Closed akinsho closed 3 years ago

akinsho commented 3 years ago

Describe the bug When trying to append a capture to an existing todo or heading from inside the capture window, after using <leader>or and selecting a sub heading, an error is thrown.

E5108: Error executing lua ...k/packer/start/orgmode.nvim/lua/orgmode/capture/init.lua:145: attempt to index local 'item' (a nil value)

To Reproduce Steps to reproduce the behavior:

  1. Open the capture menu
  2. Add some details to the template
  3. hit <leader>or to move to a specific location
  4. try to complete a sub heading e.g. todo.org/some_heading
  5. See error

Expected behavior The TODO item should be saved to the specific part/location within the org document

Emacs functionality I presume this is how it would work in Emacs.

Screenshots image

System information:

Additional context Add any other context about the problem here.

kristijanhusak commented 3 years ago

Fixed, thanks.

Note that refiling from capture window to specific headline doesn't properly demote headings, I still need to work on that.