// // TABUMAT2.VDM Christian Ziemski 15.02.1995 // 10.06.2001 // 07.09.2004 for Vedit 6.13.1 // // Set the TABs according to the words or to the "quoted items" in the current line. // // For Vedit 6.13.1 and later: 257 TABs up to column 65535 (instead of 33/1024 in older Vedits) // // Tip: Assign it to Ctrl-Shift-Q: // // Key_Add("Ctrl-Shft-Q", /[VISUAL EXIT] Save_Pos() #103=CL #104=0 OR(103) BoL Repeat(ALL){ if(CC=='"'){S('"', ADVANCE+NOERR+COUNT, 2)} DoV("\NW\") if(CL==#103 && (!At_EoL)){#105=Cur_Col if(#105>65535){break} TC(32) NT(#105,LEFT+NOCR) #104++ if(#104>256){break}}else{break}} OR(CLEAR) if(#104>0){if(#104==1){OR(103) NT(#105,NOCR) NT(#105, NOCR) OR(CLEAR)} RS(103,"Config_Tab(", INSERT) RS(103,")",APPEND) Call(103)} Restore_Pos() /,OK) // Save_Pos() // remember file position #103=Cur_Line // current line #104=0 // counter for TAB's to build Out_Reg(103) // redirect output to Reg.103 Begin_Of_Line Repeat (ALL) { if(Cur_Char=='"'){ Search('"', ADVANCE+NOERR+COUNT, 2) } Do_Visual("\NW\") // next word if(Cur_Line == #103 && (! At_EoL)) { // only same line and not line end #105=Cur_Col // current cursor column if(#105 > 65535){ // TAB's are expanded only in columns 1-65535 break } Type_Char(32) Num_Type(#105, LEFT+NOCR) #104++ // count these TAB's if(#104 > 256){ // only 257 TAB's in VEDIT allowed break } }else{ break } } Out_Reg(CLEAR) if (#104 > 0) { // if there were any TAB's created if(#104==1) { // if only one Tab => extra Out_Reg(103) // this position 2 times Num_Type(#105, NOCR) Num_Type(#105, NOCR) // (otherwise it would be Out_Reg(CLEAR) // interpreted as distance !) } Reg_Set(103,"Config_Tab(", INSERT) // command begin -> R.103 Reg_Set(103,")", APPEND) // command end -> R.103 Call(103) // execute the built command } Restore_Pos() // back to old position