Home Download Buy Blog Forum Support

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

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

Postby filipesmg on Mon Aug 27, 2012 9:03 pm

I have downloaded a Fortran bundle from this website:
https://github.com/textmate/fortran.tmbundle
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:
viewtopic.php?f=4&t=770

I have just found out what is causing the program to freeze: the problem is when I have 2 lines with comments like:
Code: Select all
   ! comment line 1
   ! comment line 2


Notice the tabs in each line. It also freezes if it is like:
Code: Select all
! comment line 1
   ! comment line 2


But it does not freezes if it's
Code: Select all
   ! comment line 1
! comment line 2

nor
Code: Select all
   ! 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! :)
(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.)
filipesmg
 
Posts: 5
Joined: Mon Aug 27, 2012 4:33 pm

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

Postby afedynitch on Sun Sep 02, 2012 9:17 pm

Hello,

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

http://code.google.com/p/sublime-text-community-packages/source/browse/trunk/ConvertedTextMateSnippets/Fortran.tmbundle/?r=519

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.
afedynitch
 
Posts: 2
Joined: Sun Sep 02, 2012 9:07 pm

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

Postby filipesmg on Wed Sep 12, 2012 4:12 am

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:
https://github.com/textmate/fortran.tmbundle
(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:
http://d.pr/i/AF4i

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.
filipesmg
 
Posts: 5
Joined: Mon Aug 27, 2012 4:33 pm

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

Postby dwannetts on Wed Sep 19, 2012 1:03 am

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

On Windows machines, this Fortran patch works perfectly.

On Ubuntu 64, it hangs.
dwannetts
 
Posts: 1
Joined: Wed Sep 19, 2012 1:01 am

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

Postby Olli on Tue Sep 25, 2012 8:53 pm

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: https://github.com/textmate/fortran.tmb ... cabbe90e0f
Olli
 
Posts: 3
Joined: Tue Sep 25, 2012 8:45 pm

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

Postby filipesmg on Fri Sep 28, 2012 4:50 pm

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

I can't understand what was done here (the changes to "improve" the comment.line):
https://github.com/textmate/fortran.tmb ... 00f03a3677

If there is no issue with the version before these changes, the problem is probably there.
filipesmg
 
Posts: 5
Joined: Mon Aug 27, 2012 4:33 pm

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

Postby Olli on Fri Sep 28, 2012 7:26 pm

At least for me, there is no problem with those earlier versions and I have no complaints on how the highlighting works.
Olli
 
Posts: 3
Joined: Tue Sep 25, 2012 8:45 pm

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

Postby filipesmg on Sat Sep 29, 2012 4:20 am

Olli,

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):

https://github.com/textmate/fortran.tmb ... xtmate-1.x

I have changed it, and it works perfectly!
So, I thank Michael once again (specially because I'm not using TextMate).
filipesmg
 
Posts: 5
Joined: Mon Aug 27, 2012 4:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 27 guests