//---------------------------------------------------------------------------- // Display list of bookmarks in a window. Use cursor keys to select bookmark. // PL 19.05.1999 //---------------------------------------------------------------------------- // Key_Purge() // clear keyboard buffer // #80 = Buf_Num // #80 = original edit buffer #85 = Cur_Pos // #85 = original edit position Win_Create(*,1,10,10,50) // Create window Win_Switch(*) Win_Color(32) Win_Clear() Buf_Switch(#81=Buf_Free) Config(PG_E_SYNTAX,0,LOCAL) // disable syntax highlighting Win_Attach(*) // Attach special window Buf_Empty(OK) // // Display bookmarks: // Buf_Switch(#80) // switch to original buffer #82 = 0 for(#83=0;#83<10;#83++) { if(Marker(#83)!=-1) { // if marker in use Goto_Pos(Marker(#83)) // go to marker position Reg_Copy(90,1) // copy line to text register 90 Buf_Switch(#81) // switch to marker list Num_Ins(#83,NOCR) // insert marker number IC(58) IC(32) // insert colon + space Reg_Ins(90) // insert the text block Buf_Switch(#80) // switch to original buffer #82++ // number of markers in list } } // // Select a bookmark from list: // Key_Purge() // clear keyboard buffer Buf_Switch(#81) // switch to marker list BOF repeat (ALL) { // Loop until or Begin_Of_Line() #84 = Num_Eval(SUPPRESS) // read marker number Block_Begin(Cur_Pos) Block_End(EOL_Pos) Begin_Of_Line() Update() // Highlight current occurrence line #88 = Get_Key("Use cursor keys and press to select or to Quit",STATLINE) if (#88=='R'+'T'*256) { // Return Break // Break out of Repeat Loop } if (#88=='E'+'S'*256) { // Escape #84 = 0 // cancel (do not go to marker) Break // Break out of Repeat Loop } if (#88=='C'+'D'*256) { // Cursor Down if (Cur_Line<#82) { Line(1,NOERR) } } if (#88=='C'+'U'*256) { // Cursor Up if (Cur_Line>1) { Line(-1,NOERR) } } } Buf_Quit(DELETE+OK) // close window Buf_Switch(#80) // return to original buffer BB(CLEAR) // remove block markers if (#84 != 0) { // if ESC not pressed Goto_Pos(Marker(#84)) // go to selected bookmark } else { Goto_Pos(#85) // go to original position }