// // TABUMAT.VDM Christian Ziemski 15.02.1995 // 10.06.2001 // // Set the TABs according to the words or to the "quoted items" in the current line. // // // Tip: Assign it to Ctrl-Q (Alt-Tab is not possible because of Windows) // // Key_Add("Ctrl-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>255){break} NT(#105,NOCR) #104+=1 if(#104>32){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 > 255){ // TAB's are expanded only in columns 1-255 break } Num_Type(#105, NOCR) // #104+=1 // count these TAB's if(#104 > 32){ // only 33 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