utilyre / barbecue.nvim

Visual Studio Code inspired breadcrumbs plugin for the Neovim editor
MIT License
776 stars 31 forks source link

[FEAT]: Can we craete a jumplist before calling the navigate? #76

Closed krehwell closed 1 year ago

krehwell commented 1 year ago

Requirements

Problem

I have this map

vim.keymap.set("n", "[[", ":lua require('barbecue.ui').navigate(-1)<CR>")

once the cursor moved, I want to get it back to the previous position with <C-o>

Solution Suggestion

we can add a jumplist before the navigate function

Workaround

-- lua/barbecue/ui.lua > M.navigate

-- ...
-- create a jump list
vim.cmd("normal! m'")

local clickable_entry = Entry.from(clickable_entries[index])
clickable_entry:navigate()