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

Folding is not right for some f90 file #1496

Open
simonnier opened this issue May 12, 2017 · 7 comments
Open

Folding is not right for some f90 file #1496

simonnier opened this issue May 12, 2017 · 7 comments

Comments

@simonnier
Copy link

Here is a fortran 90 file https://pastebin.com/siCWfA5G

If you fold the code in geany. You will find the folding is not right. You can verify this compared to notepad++

@elextr
Copy link
Member

elextr commented May 12, 2017

Folding is provided by the Scintilla editing component Geany uses, please report this to that project and report the bug number here for tracking.

@codebrainz
Copy link
Member

Notepad++ also uses Scintilla AFAIK.

Need more details, for example Geany version, operating system, description of problem, expected result, etc. "Not quite right" is not actionable, unless perhaps you're a Fortran programmer who has used Notepad++.

@simonnier
Copy link
Author

@codebrainz Ok, this is what geany folds http://pasteboard.co/5mQRcl2nG.png
and this is what notepad++ folds http://pasteboard.co/5mRJMfuD8.png

@elextr
Copy link
Member

elextr commented May 12, 2017

As @codebrainz said what version of geany

@simonnier
Copy link
Author

@elextr Ok, geany 1.29, win 10 system

@b4n
Copy link
Member

b4n commented Sep 19, 2018

I can reproduce this, and it's because we list block as a primary keyword, and the lexer folds on the block keyword. I am not sure what is the right thing to do here as I have nearly zero Fortran knowledge. And gfortran doesn't really help as it doesn't like your sample file.

The question is probably whether block is a Fortran 90 keyword, and what to do if it's not. Or whether the Scintilla folder should be more careful in where it accepts a keyword as beginning a fold.
If block is only a keyword in a newer version of Fortran, and it's not a sensible option to alter the folding code, we might have to have more Fortran filetypes for the various versions.

To go further we need more Fortran knowledge, but in the meantime you can remove the block keyword from the primary keyword list in filetypes.fortran and it should work alright.


PS: please avoid showing different input and expect them to compare equal, I understand it's not a real factor here, but my first impression seeing your two captures being of different files (simply look at the line numbers) was to believe you overlooked your test and there was no suggestion the file not working in Geany actually worked in NotePad++.

@elextr
Copy link
Member

elextr commented Sep 19, 2018

http://fortranwiki.org/fortran/show/Keywords says that in F77 (and therefore F90) the keyword is block data, two words, which neither Geany nor Scintilla will handle, but in F2008 block by itself is a keyword.

Geany does not distinguish versions of Fortran (or any language) and so the keyword lists are usually a combination up to the latest version.

As @b4n says, you would need to make yourself a custom version of the filetype file.

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

4 participants