Sublime Forum

ST2 freezes for some (Fortran?) multi-line comments


I have downloaded a Fortran bundle from this website:
and I was using it nicely, until I tried to open some older files that I had. Sublime Text freezed and I thought it could be a problem with the bundle. I have mentioned the problem here:

I have just found out what is causing the program to freeze: the problem is when I have 2 lines with comments like:

! comment line 1 ! comment line 2

Notice the tabs in each line. It also freezes if it is like:

! comment line 1 ! comment line 2

But it does not freezes if it’s

! comment line 1 ! comment line 2

! comment line 1 ! comment line 2

If I open a file with comments like this last one (with 2 tabs on the second line), and try to delete a tab, it also freezes! The opposite situation - if I don’t have identation and tab the second line - it does not freeze when I’m using the “spaces” tab. If I convert identation to tab, then it freezes!

I’m not an expert in this, so I still don’t know if the problem is in ST2 (with alignments and comments) or the Fortran bundle files. If anyone can help, I’ll be very glad! :smile:
(I know I can just not use comments like that, but some of my files already have comments like that, and also I’d have to remember that all the time - which is kind of difficult.)


Working Fortran 90 Bundle
[Fixed] Still have fortran syntax crash problem


I’m also looking for a plug-in both for F77 and modern Fortran. The Fortran-Punchcard bundle seems to work perfectly for my F77 codes.
However, the newer fortran syntax is not properly treated. I’ve found software repository

where a converted TextMate plug-in is advertised. But a recent checkout of the trunk reveals that the folder ConvertedTextmateSnippets is not available.
Some of us have to work with Fortran codes… of course mixing them with different modern languages.

If the contents of the svn folder are really available (converted for sublime), please provide some instructions how to get that snippet.



Sorry I took so long to answer - I thought I’d receive some kind of notification when someone replied my post.

As I’ve said, I’ve downloaded the plug-ins for fortran from:
(There’s an option to download the zip at the top. I put the unzipped files into a folder “Fortran” that I’ve created inside “~/Library/Application Support/Sublime Text 2/Packages/”.)

The syntax highlighting works almost perfectly. There are also snippets, which I don’t use - but they seem to be working fine.

The problems that I’ve found are the one I mentioned in the previous post and the one showed in this picture:

The line following a comment line is not highlighted correctly (some commands are highlighted, others are not). This problem may be related to the one mentioned before, since it has something to do with the following line after a comment.

I tried to look at the “Fortran - Modern.tmLanguage” file, but I have no idea how it works (so I can’t fix it). If someone has any idea, please help some poor Fortran users.



I’d like to confirm this but with a twist.

On Windows machines, this Fortran patch works perfectly.

On Ubuntu 64, it hangs.



I have the same problem the thread opener has. ST2 freezes if the document contains comments in subsequent lines. I am not willing to change my files but found that everything works fine if I do not use the most recent version of the bundle but the one before “Improve comment.line match” was committed: … cabbe90e0f



Is there any difference betwee them (in the syntax highlighting)?
So, it seems that someone messed the code… :stuck_out_tongue:

I can’t understand what was done here (the changes to “improve” the comment.line): … 00f03a3677

If there is no issue with the version before these changes, the problem is probably there.



At least for me, there is no problem with those earlier versions and I have no complaints on how the highlighting works.




After you send the link to github, I saw that the person who made the change was Michael Sheets (from TextMate). Since I’m not familiar on how github works, I asked him through twitter, and he quickly and kindly replied me that the “branch” to be used in ST2 is this one (textmate-1.x): … xtmate-1.x

I have changed it, and it works perfectly!
So, I thank Michael once again (specially because I’m not using TextMate).