hadronized / hop.nvim

Neovim motions on speed!
Other
2.48k stars 138 forks source link

Error when 'f' on empty line #352

Closed yanshay closed 1 year ago

yanshay commented 1 year ago

When cursor is on an empty line, when executing:

hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })

generates the following error

E5108: Error executing lua: ...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:129: col value outside range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        ...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:129: in function 'set_unmatched_lines'
        ...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:141: in function 'apply_dimming'
        ...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:360: in function 'hint_with_callback'
        ...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:310: in function 'hint_with'
        ...re/nvim/site/pack/packer/start/hop.nvim/lua/hop/init.lua:523: in function 'hint_char1'
        /Users/my_user/.config/nvim/lua/user/hop.lua:31: in function </Users/my_user/.config/nvim/lua/user/hop.lua:30>

It works fine when cursor is not on an empty line.

Also, at the same time,

hop.hint_char1()

Works well when cursor is on empty lines.

My setup is:

hop.setup({
    jump_on_sole_occurrence = false,
    multi_windows = true,
})
yanshay commented 1 year ago

Duplicate of #349

nonetallt commented 1 year ago

Duplicate of #349

Did you mean to reference #351 instead? I don't see how 349 is related.

yanshay commented 1 year ago

Yes, my mistake.