//COMP_NAV.VDM // Created by : PAR, 2008-11-30. // // // This macro collects a slightly enhanced version of the // Vedit distribution COMPARE.VDM navigation commands and // loads them into the {TOOLS) menu under the name // T-Compare. The main purpose of this macro is to further // study and enhance these navigation commands. Note that // the the Ctrl-E key for Visual Exit in the original macro // has been replaced by the Alt-N key. This stands for // Next difference. It would be nice to have an Alt-P key // for Previous diffrence. But this exceeds my programming // knowledge. // // This macro also could be used as an aid to the {Search, Compare} // menu to manually realign the two files. // // Usage: Select {MISC, Load/exe, COMP_NAV} or as a Key Board macro. // // // // // Reg_Set(123,'0+128 Navigation Commands U 128 Toggle between the windows, same as the key. if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} 2 Scroll both windows up, same as the key. #103=Buf_Num BS(1) DoV("\CU\") BS(2) DoV("\CU\") BS(#103) 3 Scroll both windows down, same as the key. #103=Buf_Num BS(1) DoV("\CD\") BS(2) DoV("\CD\") BS(#103) 4 Scroll both windows right, same as the key. #103=Buf_Num BS(1) DoV("\CR\") BS(2) DoV("\CR\") BS(#103) 5 Scroll both windows left, same as the key. #103=Buf_Num BS(1) DoV("\CL\") BS(2) DoV("\CL\") BS(#103) 5 Next Difference. Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Buf_Switch(1,LOCAL) Compare(2+BUFFER) 6 Repeat comparison, the same as Next. Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Buf_Switch(1,LOCAL) Compare(2+BUFFER) 12+128 Tile Windows Horizontally. Win_Tile() 12 Tile Windows Vertically._ Win_Tile(0) 1 Replace line from template, same as the key. Buf_Switch(2) Line(0) RC(103,1) Line(1) Buf_Switch(1) Line(0) Del_Line(1) RI(103) 128 *** Attention: These are Dangerous commands! *** U 128 Delete _first_ file from disk #103=BN BS(1) RS(103,PATHNAME) if(Reg_Size(103)==0){BS(#103) return} BQ(OK) BS(1) U BS(2) U FDEL(@103, OK) 0 Delete _second_ file from disk #103=BN BS(2) RS(103,PATHNAME) if(Reg_Size(103)==0){BS(#103) return} BQ(OK) BS(2) U BS(1) U FDEL(@103, OK) 128 Copy first file --> second file #103=BN BS(1) RS(103,PATHNAME) if(Reg_Size(103)==0){BS(#103) return} FS(NOMSG) BS(2) RS(104,PATHNAME) if(Reg_Size(104)==0){BS(#103) return} BQ(OK) U FCP(@103,@104, OK) BOF U BS(2) FO(@104) U 07 Copy to first file <-- second file #103=BN BS(2) RS(103,PATHNAME) if(Reg_Size(103)==0){BS(#103) return} FS(NOMSG) BS(1) RS(104,PATHNAME) if(Reg_Size(104)==0){BS(#103) return} BQ(OK) U FCP(@103,@104, OK) BOF U BS(1) FO(@104) U ') Config_String(TOOL_MENU,"&T-Compare") Key_Add("Alt-T",'[MENU]T',OK) Key_Add("F12","[VISUAL EXIT] if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)}",INSERT+OK) // Define as window toggle. Key_Add("F11","[VISUAL EXIT] Buf_Switch(2) Line(0) RC(103,1) Line(1) Buf_Switch(1) Line(0) Del_Line(1) RI(103)",INSERT+OK) // Define as "Replace line from template" Key_Add("Alt-Cursor-up",'[VISUAL EXIT]#103=Buf_Num BS(1) DoV("\CU\") BS(2) DoV("\CU\") BS(#103)',INSERT+OK) // Define as scroll both windows up Key_Add("Alt-Cursor-down", '[VISUAL EXIT]#103=Buf_Num BS(1) DoV("\CD\") BS(2) DoV("\CD\") BS(#103)',INSERT+OK) // Define as scroll both windows down Key_Add("Alt-Cursor-right", '[VISUAL EXIT]#103=Buf_Num BS(1) DoV("\CR\") BS(2) DoV("\CR\") BS(#103)',INSERT+OK) // Define as scroll both windows down Key_Add("Alt-Cursor-left", '[VISUAL EXIT]#103=Buf_Num BS(1) DoV("\CL\") BS(2) DoV("\CL\") BS(#103)',INSERT+OK) // Define as scroll both windows down Key_Add("Alt-N", '[VISUAL EXIT]Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Buf_Switch(1,LOCAL) Compare(2+BUFFER)') // Define Next diffrence Key_Add("Alt-T",`Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Char(1) if(Buf_Num==1){Buf_Switch(2)}else{Buf_Switch(1)} Buf_Switch(1,LOCAL) Compare(2+BUFFER)`) // Testing; Goto Next Difference without [VISUAL EXIT], i.e.staying in Command Mode. Return