Discussion:
[Notepad-plus-plus] [notepad-plus - Open Discussion] FORTRAN Syntax Highlighting Issue
SourceForge.net
2006-08-29 13:15:46 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3889024
By: nobody

I've been using N++ for about 6 months now and about the only complaint I have
is that syntax highlighting in FORTRAN does not work right. FORTRAN syntax is
column sensitive and if you have only spaces in your files N++ is awesome.
Unfortunately several of our source files (in source control so I can't just
edit willy-nilly) have leading tabs on the lines. These tabs get interpreted
as a single column (as far as I can tell since they are not misinterpreted as
comment lines), so that the fifth character is interpreted as a line number,
which screws up the font and coloration for the rest of the line. If it instead
saw the tab as the number of columns that a tab represents, it seems like the
problem would just disappear.

Thanks


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
SourceForge.net
2006-08-30 00:35:44 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3890265
By: bullock

Are you sure those source files aren't using free-format style Fortran (in which
column number doesn't matter)?

If so, then it seems the solution, in N++, is to assign the width of a tab character
to be 1.

Note, however, that Fortran does not specify (as I recall) how wide a tab character
is, so the compiler vendor probably gets to choose. In that case, you should
set the tab width in N++ to be whatever your compiler says it is.

Regards.
Greg

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
SourceForge.net
2006-09-06 15:28:43 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3901765
By: nobody

Yes I am sure that the FORTRAN is column sensitive.

Visual Studio has the nice solid green bar in column 6. I'm not asking for that.

I just want to have a line that starts with a tab then has a control function
like "IF" or "FOR" do be highlighted properly.

It works wonderfully if I replace the tabs with 6 spaces or whatever. And it
works millions of times better than TextPad or anything else I've tried.

If WinMerge can interpret these files correctly, why can't Notepad++. It is
hands-down the best text editor I've ever used. I don't think I'm asking for
all that much.

Thanks for the help.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
SourceForge.net
2006-09-06 19:07:45 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=3902082
By: bullock

Probably your best solution is to
(1) set the tab width in NP++ to be 6 spaces, and
(2) have NP++ replace tab characters with spaces.
The highlighting should work after that; although, with existing files, you'll
probably have to either manually replace the tab characters with 6 spaces or
save the file then reopen it (which might trigger the replacement).

If I'm not mistaken, the Fortran standard does not specify how many spaces a
tab character counts for, so if you're using tab characters in your source files,
I believe you're at the whims of your compiler interpretation of that character
(some will read it as you intend: as 6 spaces, but others will read it as a
single character and give you error messages).

In other words, I believe NP++'s behavior with respect to the tab character
is within the Fortran standard, if not within your compiler's extensions to
the standards. That your compiler is interpreting the tab character as you
intend, and NP++ is not, should be viewed as a virtue of your compiler, and
not a drawback of NP++.

Regards.
Greg


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
SourceForge.net
2007-04-03 10:13:27 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4241076
By: nobody

N++ Fortran formatting is mainly for old style Fortran 77 where cols were important.
Except there is a bug in that they allow 73 cols instead of the standard 72.

I agree is it very annoying for Fortran 90 "free-format" where columns
are irrelevent. N++ incorrectly colour codes and font changes in the wrong spots.
The best soltn is to wait for an enhancement that either has a Fortran 90 style
or enable users to configure the columns themselves.

AMo

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
mori
2014-12-05 06:10:12 UTC
Permalink
because there is a tab (s) in your line command, dont use tab. using space
SourceForge.net
2007-04-03 21:26:48 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4242227
By: bullock

You don't have to wait. My colleagues and I use the following in
our UserDefineLang.xml file:

<UserLang name="FortranFreeform" ext="f90 f95 f2k">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&apos;&quot;0&apos;&quot;0</Keywords>
<Keywords name="Folder+">do then</Keywords>
<Keywords name="Folder-">enddo endif end</Keywords>
<Keywords name="Operators">- % &amp; ( ) * , . / : ; + &lt;
= &gt;</Keywords>
<Keywords name="Comment">1 2 0!</Keywords>
<Keywords name="Words1">access action advance allocatable allocate
apostrophe assign assignment associate asynchronous backspace bind blank blockdata
call case character class close common complex contains continue cycle data
deallocate decimal delim default dimension direct dowhile double doubleprecision
else elseif elsewhere encoding end endassociate endblockdata endfile endforall
endfunction endinterface endmodule endprogram endselect endsubroutine endtype
endwhere entry eor equivalence err errmsg exist exit external file flush fmt
forall form format formatted function go goto id if implicit in include inout
integer inquire intent interface intrinsic iomsg iolength iostat kind len logical
module name named namelist nextrec nml none nullify number only open opened
operator optional out pad parameter pass pause pending pointer pos position
precision print private program protected public quote read readwrite real rec
recl recursive result return rewind save select selectcase selecttype sequential
sign size stat status stop stream subroutine target to type unformatted unit
use value volatile wait where while write</Keywords>
<Keywords name="Words2">abs achar acos acosd adjustl adjustr aimag
aimax0 aimin0 aint ajmax0 ajmin0 akmax0 akmin0 all allocated alog alog10 amax0
amax1 amin0 amin1 amod anint any asin asind associated atan atan2 atan2d atand
bitest bitl bitlr bitrl bjtest bit_size bktest break btest cabs ccos cdabs cdcos
cdexp cdlog cdsin cdsqrt ceiling cexp char clog cmplx conjg cos cosd cosh count
cpu_time cshift csin csqrt dabs dacos dacosd dasin dasind datan datan2 datan2d
datand date date_and_time dble dcmplx dconjg dcos dcosd dcosh dcotan ddim dexp
dfloat dflotk dfloti dflotj digits dim dimag dint dlog dlog10 dmax1 dmin1 dmod
dnint dot_product dprod dreal dsign dsin dsind dsinh dsqrt dtan dtand dtanh
eoshift epsilon errsns exp exponent float floati floatj floatk floor fraction
free huge iabs iachar iand ibclr ibits ibset ichar idate idim idint idnint ieor
ifix iiabs iiand iibclr iibits iibset iidim iidint iidnnt iieor iifix iint iior
iiqint iiqnnt iishft iishftc iisign ilen imax0 imax1 imin0 imin1 imod index
inint inot int int1 int2 int4 int8 iqint iqnint ior ishft ishftc isign isnan
izext jiand jibclr jibits jibset jidim jidint jidnnt jieor jifix jint jior jiqint
jiqnnt jishft jishftc jisign jmax0 jmax1 jmin0 jmin1 jmod jnint jnot jzext kiabs
kiand kibclr kibits kibset kidim kidint kidnnt kieor kifix kind kint kior kishft
kishftc kisign kmax0 kmax1 kmin0 kmin1 kmod knint knot kzext lbound leadz len
len_trim lenlge lge lgt lle llt log log10 logical lshift malloc matmul max max0
max1 maxexponent maxloc maxval merge min min0 min1 minexponent minloc minval
mod modulo mvbits nearest nint not nworkers number_of_processors pack popcnt
poppar precision present product radix random random_number random_seed range
real repeat reshape rrspacing rshift scale scan secnds selected_int_kind
selected_real_kind set_exponent shape sign sin sind sinh size sizeof sngl snglq
spacing spread sqrt sum system_clock tan tand tanh tiny transfer transpose trim
ubound unpack verify</Keywords>
<Keywords name="Words3">cdabs cdcos cdexp cdlog cdsin cdsqrt cotan
cotand dcmplx dconjg dcotan dcotand decode dimag dll_export dll_import doublecomplex
dreal dvchk encode find flen flush getarg getcharqq getcl getdat getenv gettim
hfix ibchng identifier imag int1 int2 int4 intc intrup invalop iostat_msg isha
ishc ishl jfix lacfar locking locnear map nargs nbreak ndperr ndpexc offset
ovefl peekcharqq precfill prompt qabs qacos qacosd qasin qasind qatan qatand
qatan2 qcmplx qconjg qcos qcosd qcosh qdim qexp qext qextd qfloat qimag qlog
qlog10 qmax1 qmin1 qmod qreal qsign qsin qsind qsinh qsqrt qtan qtand qtanh
ran rand randu rewrite segment setdat settim system timer undfl unlock union
val virtual volatile zabs zcos zexp zlog zsin zsqrt</Keywords>
<Keywords name="Words4">eq and or ne ge gt le lt true
false</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF"
fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="0000FF"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="0000FF"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF"
fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="8000FF" bgColor="FFFFFF"
fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="0080C0" bgColor="FFFFFF"
fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="808080" bgColor="FFFFFF"
fontName="" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF"
fontName="" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="NUMBER" styleID="4" fgColor="FF0000" bgColor="FFFFFF"
fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="000080"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="8000FF"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="8000FF"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000"
bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>

It's not perfect, but it's pretty good.

Regards.
Greg

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
SourceForge.net
2007-06-04 10:47:44 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4342861
By: nobody

What about changing the source code?
Threr is a file in the source code, named "LexFortran.cxx". In this file there
are definitions of when the program uses different styles and colors.
I thought of two possibilities:
1. assignment of isFixFormat variable to be true, but I haven't found where
the definitions of this case are.
2. changing in the "Handle the fix format generically" section the conditions
of toLineStart variable.
I don't have the right compiler to try it, and I also don't understand so much
in programming, so I'm afraid to try it.
But, what do tou think about it?
Morag

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
SourceForge.net
2007-06-04 11:13:02 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4342890
By: nobody

I forgot to say that this file is located in /scintilla/src/ library.
If you think it's good, we can post it to the developers.
Morag

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=331753
Continue reading on narkive:
Loading...