Within NEdit mailing list a build-in macro subroutine
was requested, which allows the conversion of line /
column number to a related text buffer position.
Sometimes it may also of interest to convert a given
position to a related line / column number.
Attached patch implements 3 build-in macro subroutines
which allow position <-> line / column conversion:
1.) to_pos( [line-number] [, column-number] )
Convert given line number and column number to a text
buffer position in current window. Parameters of
"to_pos" follow the same syntax than parameters of
2.) to_column( position )
Convert given position to column number in current window.
3.) to_line( position )
Convert given position to line number in current window.
The patch was made against "NEdit 5.4RC1" source tar
ball (available at ftp://ftp.nedit.org/). I've tested
the patch within following environments:
Built on: Solaris, Sparc, GNU C
With Motif: 1.2.6 [@(#)OSF/Motif Version 1.2.6]
Running Motif: 1.2 [@(#)OSF/Motif Version 1.2.6]
Server: Sun Microsystems, Inc. 6410
Built on: Linux, 386, GNU C
With Motif: 2.1.30 [@(#)Motif Version 2.1.30]
Running Motif: 2.1 [unknown]
Server: The XFree86 Project, Inc 40300000
README.txt (included in gzipped patch tar ball)
includes some hints about how to apply the patch.
More info about the new macro subroutines can be found
a.) in "FEATURE.txt" document (included in patch tar ball)
b.) by selecting menu item "Help" -> "Macro
Shell/Extensions" -> "Macro Subroutines" after patch
was applied, help doc. was rebuild and NEdit was
compiled of course :-)