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
vim packages not being folded. #251
Comments
Thanks for the bug report, @Jeansen! It seems that this form is folded: package Null;
my $null = bless {}, __PACKAGE__;
sub AUTOLOAD {$null}
sub ok {0} But not the one you posted. Let's see if we can get that fixed! |
Hey @hoelzro! Thank's for the quick answer. I would really appreciate a fix 😄 If I can be of support in any way, just let me know! |
@Jeansen I just pushed some tests for "braced" packages - we could benefit from more tests (ex. If you feel comfortable writing tests, that would be great - if you feel up to the challenge of debugging why the folding Vimscript isn't working, that would be even better! |
@hoelzro Thank you. I'll have a look and see, what I can do. I am no Vimscript expert, but I'll take the challenge. But it might take some time. |
@hoelzro I am not sure, if I am missing something, but when I use the following vimrc and try to fold the snippet from #251 (comment) then I do not see any change. Here's my minimalistic vimrc:
|
Hmm...looking at the code it turns out that setting |
Oh...well. Now I am ashamed to not have checked it myself 😊 Must be, because I am still in the Perl-Universe 😆 |
And yes, without |
I have made a PR with something working. Could you check, please? 😄 |
BTW, I noticed, that I have to delete my perl.vim in the vim home folder. Should it not be overwritten/overruled by the plugin installation? |
It depends on how you're installing your plugins - if you're using something like Pathogen, for example, |
@Jeansen Sorry for the delay on this - I don't get a lot of time to work on vim-perl, and every time I do I feel like I'm just remembering where I was at! I believe I have fixed the package folding issue - could you grab what's on the dev branch and verify that it works? |
@hoelzro No problem, same here ;) Backage folding issue seems to be resolved. Great work! Thank you 😃 |
Hey @hoelzro. I hope you are doing fine? After some months of absence, I finally found some time to get back to my project. Thou your fix solve some folding problems, it still is not doing everything as expected. It seems to be a bit too eager ;-) If I use your current fix from the development branch and use syntax folding on https://github.com/Jeansen/cdmn/blob/master/cdmn , then some packages are recursively folded beneath package Could you check again? I bet it is just a very little change that has to be done ;) |
Hi @Jeansen! I will try to check this out later today |
Hi again @Jeansen - sorry this took me so long to check out! I had some time to look tonight, and I was able to fix it - but not without breaking folding for anonymous subs. I think I'll need to step back and see how I unify these two ideas. |
Hi @hoelzro. Thanks for all your efforts! Do not hurry yourself. There is no rush 😉 But maybe you will find some more time to also fix the folding for anonymous subs. Keep on the good work! 😄 |
@hoelzro: Did you push your fix? I cannot find it on dev ... |
@Jeansen No fix yet, I'm afraid - I can't push what I have since it breaks anonymous subs =( |
Oh, ok. No problem. Then I'll wait until you find a fix 😃 |
Has this issue been abandoned? At first glance, this plugin seems unmaintained and kind of unusable but maybe I'm using it wrong. |
Not abandoned. Still maintained. But it looks like nobody has a fix for it. |
K, thanks. I'm investigating. Started with a clean vim install on a new OS. I'm poking around. I just know enough vim scripting to be dangerous, though. |
That's OK. Any vim scripting is dangerous. |
Well, so commenting out line 394 in
|
And commenting out line 393 keeps both the highlighting and the indenting. But not sure if that might break folding or what. Line 393:
|
Yeah, that breaks folding. It folds all subs into a singe fold. |
OK, this seems to do the trick:
This line should replace line 392 (or thereabout). Untested, though. How do I do that? Is this a perl module I can download? UPDATE: NVM, figured out how to run the tests. |
@sdondley Thanks for looking into this - by the way, if you want quick feedback on whether or not a change would break something, the test suite runs highlighting and folding against some known sharp corners, as well as a pretty good corpus of Perl modules from the CPAN. It even gives you pretty feedback like this for highlighting failures: You may need to install some Perl modules to run the test suite, but we're happy to assist! |
Yeah, just got done running the tests. As I suspected, it failed on anon subroutines. Not sure what the corpus tests are but it failed many of those. But basically the issue is that the regions is "covering" the braces. By adjusting where the region begins and ends with the offset values, you can "move" the beginning and ending of the region so the braces are "uncovered." Then the indentation will work properly. |
Oops, all these previous comments of mine were mean for #267. Sorry! |
Ah, ok - vim-perl could really use some proper indent tests! The "corpus" tests are essentially golden master tests that make sure that highlighting and folding is consistent across a few modules I picked - they make sure that, for the most part, users don't see code suddenly highlight differently when a change is made. |
Description of issue
I am not able to fold packages.
Your description here!
Maybe I am missing something, but though I have set
foldmethod=syntax
and fiddled around with all the different settings, I get everything to work - except code-folding for packages.E.g.:
My settings:
I've also tried
let g:perl_nofold_packages
with 0/1, but no setting worked.If it is a real bug, I'd definitely appreciate a fix :) If I just missed something, I would be grateful for any help.
The text was updated successfully, but these errors were encountered: