Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when selecting to add a new task to a project during a capture #472

Closed
3 tasks done
akinsho opened this issue Jun 1, 2022 · 5 comments
Closed
3 tasks done
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@akinsho
Copy link

akinsho commented Jun 1, 2022

Prerequisites

  • I have read contribution guidelines
  • I am using the latest version of the plugin
  • I am using either 0.6 stable or the latest compiled neovim version

Neovim Version

NVIM v0.8.0-dev+1802-g7380ebfc1

Neorg setup

require('neorg').setup({
    configure_parsers = true,
    load = {
      ['external.kanban'] = {},
      ['core.defaults'] = {},
      ['core.integrations.telescope'] = {},
      ['core.keybinds'] = {
        config = {
          default_keybinds = true,
          neorg_leader = '<localleader>',
          hook = function(keybinds)
            keybinds.unmap('norg', 'n', '<C-s>')
            keybinds.map_event('norg', 'n', '<C-x>', 'core.integrations.telescope.find_linkable')
          end,
        },
      },
      ['core.norg.completion'] = {
        config = {
          engine = 'nvim-cmp',
        },
      },
      ['core.norg.concealer'] = {},
      ['core.norg.dirman'] = {
        config = {
          workspaces = {
            notes = fn.expand('$SYNC_DIR/neorg/notes/'),
            tasks = fn.expand('$SYNC_DIR/neorg/tasks/'),
            work = fn.expand('$SYNC_DIR/neorg/work/'),
          },
        },
      },
      ['core.gtd.base'] = {
        config = {
          workspace = 'tasks',
        },
      },
    },
  })

Actual behavior

When trying to add a new task using Neorg gtd capture when getting to the stage where I'm asked where to add the task and selecting a project trying to then select <CR> to submit the capture errors.

Screen Shot 2022-06-01 at 15 57 00

E5108: Error executing lua ...r/start/nvim-treesitter/lua/nvim-treesitter/ts_utils.lua:305: attempt to index local 'node_or_range' (a nil value)                                     
stack traceback:                                                                                                                                                                     
        ...r/start/nvim-treesitter/lua/nvim-treesitter/ts_utils.lua:305: in function 'get_node_range'                                                                                
        ...rt/neorg/lua/neorg/modules/core/gtd/queries/creators.lua:235: in function 'insert_tag'                                                                                    
        ...rt/neorg/lua/neorg/modules/core/gtd/queries/creators.lua:62: in function 'create'                                                                                         
        ...rt/neorg/lua/neorg/modules/core/gtd/ui/capture_popup.lua:508: in function <...rt/neorg/lua/neorg/modules/core/gtd/ui/capture_popup.lua:491>                               
        ...tart/neorg/lua/neorg/modules/core/ui/selection_popup.lua:343: in function <...tart/neorg/lua/neorg/modules/core/ui/selection_popup.lua:329>                               
        ...tart/neorg/lua/neorg/modules/core/ui/selection_popup.lua:22: in function 'invoke_key_in_selection'                                                                        
        [string ":lua"]:1: in main chunk

Expected behavior

The expected behaviour is that the capture is completed, and the task is correctly added which it is not.

Steps to reproduce

  1. Create a gtd project somewhere and add some tasks, there is no space between the projects and the following tasks.
  2. Go to another unrelated buffer (not sure this is relevant), run Neorg gtd capture
  3. Add in all the data, at the point where it says where to add use p to choose your project
  4. Press <CR> to confirm

Potentially conflicting plugins

No response

Other information

No response

Help

No

Implementation help

No response

@akinsho akinsho added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Jun 1, 2022
@max397574
Copy link
Contributor

is it perhaps the same as this?
#388

@akinsho
Copy link
Author

akinsho commented Jun 1, 2022

It looks like the same error message although I didn't set a time on my task

@terrortylor
Copy link

terrortylor commented Jun 6, 2022

I get the same issue, I'm able to replicate this by adding a task to a project in a norg file that:

  • is the last project in a file
  • has no blank or non-task related lines after it

I work around at the moment is to add the following to the end of any GTD norg files:


Prevent https://github.com/nvim-neorg/neorg/issues/472 with a extra line at end of file.

EDIT:
However this seems to not continue to "workaround" the issue once vim or the GTD neorg buffer is closed/wiped.

Adding a dummy project to the end of the neorg file however, does seem to continue to workarond the issue when wiping hte buffer or closing vim

@Generic0x59
Copy link

Another Workaround i found is to add a unclarified Task(no comments in front of task) as first Task in a project.

@d-r-a-b
Copy link
Contributor

d-r-a-b commented May 1, 2023

Hi there! Just a community member going through the old issues. It looks like this refers to features of the GTD module which was dropped recently. Would you mind closing this issue?

#695 provides rationale for the change and a plan for moving forward as the devs/contributers make sure to get things right before committing the community in a bad direction at this alpha stage. Lists and TODOs still work great and there is really cool work going on right now to advance the macro system, so there's lots of exciting stuff down the pipeline!

@akinsho akinsho closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

5 participants