In this variation, we remain in the Viewer, rather than call
an editor.
; ViewNonMatchingLines.ztm - Called from Viewer with F12
; where a search string and some hits already exist.
; This is a workaround for ZEP:
; http://vujnovic.free.fr/ztw/ztw_zeps.html#ZEP500
; Customizations for your environment:
; 1. Temporary file: %TEMP%\zt$$$nonmatch.tmp
;
; Don't allow this macro to execute from DW
STOP_IF_DW,
; Don't allow this macro to execute from FW -- this
; does not work because Viewer thinks it is in FW
; STOP_IF_FW,
;
; ZEP:
; * We need STOP_IF_NOT_VIEWER to allow certain
; * macros to execute only in Viewer
;
; Grab last search "string" from history
f,UP,RET,HOME,SH_END,CTRL_INS,ESC,
; In eXecute window, FIND /V "string" (exclude) in current file
x,CTRL_BKSP,@FIND,SPACE,/I,SPACE,/V,SPACE,QUOTE,SH_INS,QUOTE,SPACE,
; Insert current filespec
TAB,SPACE,
; Capture output in %TEMP%\zt$$$nonmatch.tmp
>%TEMP%\zt$$$nonmatch.tmp,RET,
; View output in Viewer. First go to DW
ESC,ESC,
v,%TEMP%\zt$$$nonmatch.tmp,RET,
; We should be in the Viewer looking at a smaller file
; that consists of only the non-matching lines
STOP