// // Auto-Backspace V1.0 (C) C.Z. 14.04.97 // 14.04.97 // // // // // Example: // // // {{{... // // // // // // //========================================================================== // // I'm using the key assignment Ctrl-Tab for that macro. // // Here it is in one line: // // if (CL>1) { if(CRN>1) { Num_Push(95,99) #99=CP #95=CRN while (CL>1){#96=CRN DoV("\CU\") #98=CL DoV("\PW\") if (CL==#98){#97=CRN GP(#99) DC(#97-CN) Num_Pop(95,99)return}else{GL(#98) GC(#96,EXTRA)}}GP(#99)GC(#95,EXTRA)Num_Pop(95,99) }} // //========================================================================== // // and documented: // if (Cur_Line>1) { // not possible in line 1 if (Cursor_Col>1) { // no action in column 1 Num_Push(95,99) // save the used registers #99=Cur_Pos // remember position #95=Cursor_Col // and visual column while (Cur_Line>1) // !!! change 'while' to 'if' if only { // !!! ONE line above should be checked #96=Cursor_Col // remember visual column Do_Visual("\CU\") // Cursor Up #98=Cur_Line // remember line# // Do_Visual("\PW\") // Previous Word S("|S|!|W",REVERSE+NOERR) char(1) if (Cur_Line==#98) // if prev. word was found in the same line { #97=Cursor_Col // remember visual column Goto_Pos(#99) // goto starting point Del_Char(#97-Cur_Col) // delete the appropriate quantity of chars Num_Pop(95,99) // restore the used register return // ready and exit } else // if no next word in the above line { GotoLine(#98) // repeat the search with GotoCol(#96,EXTRA) // the next line above } } Goto_Pos(#99) // restore old cursor position GotoCol(#95,EXTRA) // restore virtual position too Num_Pop(95,99) // restore used registers } }