Skip to content

[BUG] api.uncomment.linewise.* give error when nothing to uncomment #221

@bew

Description

@bew

Plugin version: 728f38e

Using following config:

require('Comment').setup {
  mappings = {
    extended = true
  }
}

Given some file foo.c:

abc

With the cursor on the line, using g<c will give the following error:

E5108: Error executing lua Vim(lua):E5108: Error executing lua ...m-wip/managed-plugins/Comment.nvim/lua/Comment/utils.lua:65: attempt to get length of local 'iter' (a nil value)
stack traceback:
        ...m-wip/managed-plugins/Comment.nvim/lua/Comment/utils.lua:65: in function 'is_empty'
        ...m-wip/managed-plugins/Comment.nvim/lua/Comment/utils.lua:297: in function 'uncomment'
        ...-wip/managed-plugins/Comment.nvim/lua/Comment/opfunc.lua:176: in function 'linewise'
        ...-wip/managed-plugins/Comment.nvim/lua/Comment/opfunc.lua:68: in function 'opfunc'
        ...vim-wip/managed-plugins/Comment.nvim/lua/Comment/api.lua:284: in function 'current'
        [string ":lua"]:1: in main chunk
        [C]: at 0x004609a0
stack traceback:
        [C]: at 0x004609a0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions