Open riodelphino opened 1 year ago
I am not sure how to solve this at the moment. The issue is that NeoView sets the cursor position when you enter a new buffer. I haven't found a good method to be able to determine if you have entered the buffer by opening the file or via Telescope.
Thank you for reply.
This is just an idea.
Create autocmd
vim.api.nvim_create_autocmd("BufLeave", {
callback = function()
if vim.o.filetype == "TelescopePrompt" then vim.g.neoview_disable = true end
end,
})
-- I chose `BufLeave` to get the filetype `TelescopePrompt`, because `BufEnter` doesn't show me that filetype.
In the BufEnter
after leaving Telescope, check the vim.g.neoview_disable
. If true
, do not restore the view.
Then reset the flag. vim.g.neoview_disable = false
How's like this ? Do you think it works ?
Hi, it's realy nice work !
But I have a situation like below.
sample file
test.py
Reproduction steps
Expected behaviour
Normally(without NeoView), the ':Telescope live_grep' command bring me to the line 100, which I searched for.
Actual behaviour
NeoView restored the previous row position, so the cursor is on line 50.
Is there a option for this ?
I saw this code, but I don't think 'disabled' list is the solution in this case.
Thank you.