Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Cursor position outside buffer in Telescope #250

Closed
3 tasks done
kiyoon opened this issue Jan 18, 2023 · 6 comments · Fixed by #251
Closed
3 tasks done

bug: Cursor position outside buffer in Telescope #250

kiyoon opened this issue Jan 18, 2023 · 6 comments · Fixed by #251
Labels
bug Something isn't working

Comments

@kiyoon
Copy link

kiyoon commented Jan 18, 2023

Did you check docs and existing issues?

  • I have read all the trouble.nvim docs
  • I have searched the existing issues of trouble.nvim
  • I have searched the exsiting issues of plugins related to this issue

Neovim version (nvim -v)

0.8.2

Operating system/version

Ubuntu 22.04

Describe the bug

image

I think the plugin doesn't understand where the files actually are. It doesn't open it properly with this error message.

Steps To Reproduce

I think it happens when the cwd from the Telescope args has changed, or using builtin.git_files

-- get git folder
local function get_git_dir()
  local git_dir = vim.fn.trim(vim.fn.system "git rev-parse --show-toplevel")
  return git_dir
end

local builtin = require "telescope.builtin"

M = {}
M.live_grep_gitdir = function()
  local git_dir = get_git_dir()
  if git_dir == "" then
    builtin.live_grep()
  else
    builtin.live_grep {
      cwd = git_dir,
    }
  end
end

Expected Behavior

It should read the actual file path and find the files correctly. Maybe trouble is assuming a default cwd.

Repro

No response

@kiyoon kiyoon added the bug Something isn't working label Jan 18, 2023
@folke folke closed this as completed in 3174767 Jan 19, 2023
@kiyoon
Copy link
Author

kiyoon commented Jan 19, 2023

Thanks for the quick fix!

@varunbpatil
Copy link

@folke the fix (3174767) breaks telescope LSP references -> Trouble for golang. Had to revert to trouble v1.0.0

@folke
Copy link
Owner

folke commented Feb 10, 2023

@varunbpatil what is the error you get? Need to know how exactly to fix this. Not going to install golang for this

@folke
Copy link
Owner

folke commented Feb 10, 2023

Can reproduce with lua. will fix

@folke
Copy link
Owner

folke commented Feb 10, 2023

@varunbpatil should be fixed now

@varunbpatil
Copy link

Thanks @folke . Can confirm that it is working with golang too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants