LunarVim / Neovim-from-scratch

📚 A Neovim config designed from scratch to be understandable
https://www.chrisatmachine.com/
GNU General Public License v3.0
5.31k stars 1.18k forks source link

pressing TAB on an old empty line sometimes jumps to a random line. #322

Open ostap-tymchenko opened 9 months ago

ostap-tymchenko commented 9 months ago

I've had this issue for at least a year now where sometimes when being on an empty line that was entered using and pressing tab, jumps to a seemingly random part of the open document. I have not been able to recreate it whilst recording, but the issue is really annoying.

Ill send in an update if I manage to record it.

My dots are found here: https://github.com/ostap-tymchenko/nvim-dots/

ostap-tymchenko commented 9 months ago

RECORDING>> https://youtu.be/JdqCMqTvmkM

laris commented 8 months ago

ditto.

I also don't know why and cannot figure out how to locate issue.

laris commented 7 months ago

did you figure out why? @ostap-tymchenko

ostap-tymchenko commented 7 months ago

did you figure out why? @ostap-tymchenko

It was some extension. I turned them on and off until I found the broken one. I can't remember which one it is now, and I stopped using neovim-from-scratch, and just made a custom one similar to it.

laris commented 7 months ago

Thanks for your tips.

laris commented 7 months ago

I guess it should be these lines: LuaSnip should have Tab multiple functions. https://github.com/L3MON4D3/LuaSnip

    -- Accept currently selected item. If none selected, `select` first item.
    -- Set `select` to `false` to only confirm explicitly selected items.
    ["<CR>"] = cmp.mapping.confirm { select = true },
    ["<Tab>"] = cmp.mapping(function(fallback)
      if cmp.visible() then
        cmp.select_next_item()
      elseif luasnip.expandable() then
        luasnip.expand()
      elseif luasnip.expand_or_jumpable() then
        luasnip.expand_or_jump()
      elseif check_backspace() then
        fallback()
      else
        fallback()
      end
    end, {
      "i",
      "s",
    }),