advanced linked lists the two operations is which character is deleted and what happens to the cursor afterward in the delete operationthe character at the cursor position is removed and the cursor remains at the same position the rub-out operationon the other handremoves the character preceding the cursor and then moves the cursor one position to the left when newline character is deletedthe current line and the one immediately following are merged the newline character at the end of the last line in the document cannot be deleted most text editors provide other text manipulation operations such as truncating line from the cursor position to the end of the line this operation typically does not remove the newline character at the end of the linebut instead simply deletes the non-newline characters from the cursor position to the end of the line some editors may also provide an operation to delete the entire line on which the cursor is positioned the edit buffer adt we are now ready to define an edit buffer adt that can be used with simple text editor our definition is based on the description of text editors presented in the previous section in order to keep the example simplewe limit the operations available with our adt define editbuffer adt an edit buffer is text buffer that can be used with text editor for storing and manipulating the text as it is being edited the buffer stores plain text with no special formatting or markup codesother than the common ascii special characters like tabs and newlines individual lines are terminated with newline character the current cursor position is maintained and all operations are performed relative to this position the cursor can only be positioned where character currently exists the cursor can never be moved outside the bounds of the document the buffer can insert characters in either insert or overwrite entry mode editbuffer()creates new and empty edit buffer an empty buffer always contains single blank line and the cursor is placed at the first position of this blank line the entry mode is set to insert numlines()returns the number of lines in the text buffer numchars()returns the length of the current line that includes the newline character lineindex()returns the line index of the line containing the cursor the first line has an index of columnindex()returns the column index of the cursor within the current line the first position in each line has an index of