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

cannot jump when cursor is on line number #27

Open
aca opened this issue Sep 26, 2020 · 4 comments
Open

cannot jump when cursor is on line number #27

aca opened this issue Sep 26, 2020 · 4 comments

Comments

@aca
Copy link

aca commented Sep 26, 2020

~/src/k8s.io/ingress-nginx/internal/ingress/controller/nginx.go:665

If cursor is on the 665, we cannot jump to the file with error

E447: Can't find file "665" in path

It would be much better if we can jump to the file even if cursor is at line/column number.

@wsdjeg
Copy link
Owner

wsdjeg commented Sep 30, 2020 via email

@aca
Copy link
Author

aca commented Oct 1, 2020

@wsdjeg

os: mac/linux 
vim: NVIM v0.5.0-d5adc8c

let l:cfile = expand('<cfile>')

After cursor ':' . This is expended to :665~
Native vim gF also doesn't handle this correctly, but It would be helpful if this plugin can solve this.

@aca
Copy link
Author

aca commented Feb 20, 2021

function s:gF()
  try 
    execute "normal! gF"
  catch 
    try 
      execute "normal! bgF"
    catch
      execute "normal! bbgF"
    endtry
  endtry
endfunction
nnoremap gf :call <sid>gF()<cr>

Foolish workaround for this.

@wsdjeg
Copy link
Owner

wsdjeg commented Feb 20, 2021

That means we should not use expand('<cfile>'), we should implement a new function to get the file path of under cursor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants