ZTree.com  | ZEN  | About...  

 Index   Back

macro   [Q]

By: Hartmut Schneider     Germany  
Date: Nov 27,2013 at 03:51
In Response to: [Q] Is there a way to obtain the line number when viewing a file ? (Bob Selby)

> Is there a way to obtain the line number from the viewer (if in
> "highlight line mode") and pass it to the editor so saving me a duplicate
> search ??
>
> My editor has an "-Gnnn" switch to allow it to go to the specified
> line.

I have a macro for that purpose,
it fetches the line number via the Offset command in Viewer.

; call Offset to load Current Line Number into CLP:
; (does nothing to CLP: if Line mode Off)
o,CTRL_INS,ESC,

; in Execute window, start Notepad2 for current file
; with current line number as line offset (&col n for cursor visibility)
; and wait until it closes
x,CTRL_BKSP,@Notepad2.exe /g ,SH_INS,COMMA,1 ,TAB,RET,

; back to Viewer, Refresh to show modifications (if any)
ESC,F3,

You only have to replace the above /g by your editor's syntax.
BTW, TAB in eXecute echoes (fills in) the current filename.

Hartmut

1,056 views      
Thread locked
 

Messages in this Thread

 
96,646 Postings in 12,231 Threads, 350 registered users, 71 users online (0 registered, 71 guests)
Index | Admin contact |   Forum Time: Apr 28, 2024 - 11:41 pm UTC  |  Hits:63,123,429  (18,099 Today )
RSS Feed