8000 Use suffixesadd for .pm · Issue #313 · vim-perl/vim-perl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use suffixesadd for .pm #313

New issue

Have a question about this project?< 8000 /strong> 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

Open
Altreus opened this issue Jan 31, 2022 · 6 comments
Open

Use suffixesadd for .pm #313

Altreus opened this issue Jan 31, 2022 · 6 comments

Comments

@Altreus
Copy link
Altreus commented Jan 31, 2022

setlocal includeexpr=substitute(substitute(substitute(substitute(v:fname,'+','',''),'::','/','g'),'->\*','',''),'$','.pm','')

Better written as:

setlocal includeexpr=substitute(substitute(substitute(v:fname,'+','',''),'::','/','g'),'->\*','','')
setlocal suffixesadd+=.pm

This allowed me to update the includeexpr to handle paths to real files: I had an issue whereby vim saw an absolute path, and it was easy to strip the leading / if the includeexpr didn't also append .pm

@Altreus
Copy link
Author
Altreus commented Jan 31, 2022

Incidentally, I believe ->\* should be ->.* because the presence of this \ has no effect on my vim, but ->* matches - and thus breaks non-module filenames. I suspect the intention here was to remove -> and anything after.

@petdance
Copy link
Contributor

@dkearns Thoughts?

@mannih
Copy link
mannih commented Feb 1, 2022

I guess I'm the one who dragged in ->\*. The intention was to make it possible for gf and friends to open the module in code like Foo::Bar->new, which works (at least for me). OTOH, ->.* works as well, but ->.+ seems even better?

@petdance
Copy link
Contributor
petdance commented Feb 1, 2022

Agreed, .+ seems better.

@dkearns
Copy link
Contributor
dkearns commented Feb 2, 2022

LGTM

@petdance
Copy link
Contributor
petdance commented Feb 3, 2022

@Altreus Would you like to make a PR for this? Or should I just cut & paste your code?

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

No branches or pull requests

4 participants
0