Buggy code:
public class CompleteWord extends JWindow { public static void completeWord ( JEditTextArea textArea ) { } public CompleteWord ( JEditTextArea textArea , String word , Vector completions , Point location ) { } public void dispose ( ) { } private static String getNonAlphaNumericWordChars ( Buffer buffer , KeywordMap keywordMap , int caret ) { } private static String getWordToComplete ( Buffer buffer , int caretLine , int caret , String noWordSep ) { } private static Vector getCompletions ( Buffer buffer , String word , KeywordMap keywordMap , String noWordSep , int caret ) { } private static String completeWord ( String line , int offset , String noWordSep ) { } private View view ; private String word ; private JList words ; private void insertSelected ( ) { } static class Completion { String text ; boolean keyword ; Completion ( String text , boolean keyword ) { } public String toString ( ) { } public boolean equals ( Object obj ) { } } static class Renderer extends DefaultListCellRenderer { static Font plainFont = new Font ( "Dialog" , Font . PLAIN , 12 ) ; static Font boldFont = new Font ( "Dialog" , Font . BOLD , 12 ) ; public Component getListCellRendererComponent ( JList list , Object value , int index , boolean isSelected , boolean cellHasFocus ) { } } class KeyHandler extends KeyAdapter { public void keyPressed ( KeyEvent evt ) { switch ( evt . getKeyCode ( ) ) { case KeyEvent . VK_TAB : case KeyEvent . VK_ENTER : insertSelected ( ) ; evt . consume ( ) ; break ; case KeyEvent . VK_ESCAPE : dispose ( ) ; evt . consume ( ) ; break ; case KeyEvent . VK_UP : int selected = words . getSelectedIndex ( ) ; if ( selected == 0 ) selected = ( words . getModel ( ) . getSize ( ) ) - 1 ; else if ( ( getFocusOwner ( ) ) == ( words ) ) return ; else selected = selected - 1 ; words . setSelectedIndex ( selected ) ; words . ensureIndexIsVisible ( selected ) ; evt . consume ( ) ; break ; case KeyEvent . VK_DOWN : selected = words . getSelectedIndex ( ) ; if ( selected == ( ( words . getModel ( ) . getSize ( ) ) - 1 ) ) selected = 0 ; else if ( ( getFocusOwner ( ) ) == ( words ) ) return ; else selected = selected + 1 ; words . setSelectedIndex ( selected ) ; words . ensureIndexIsVisible ( selected ) ; evt . consume ( ) ; break ; case KeyEvent . VK_BACK_SPACE : if ( ( word . length ( ) ) == 1 ) { <START_BUG> textArea . backspace ( ) ; <END_BUG> dispose ( ) ; } else { word = word . substring ( 0 , ( ( word . length ( ) ) - 1 ) ) ; Buffer buffer = view . getBuffer ( ) ; JEditTextArea textArea = view . getTextArea ( ) ; textArea . backspace ( ) ; int caret = textArea . getCaretPosition ( ) ; KeywordMap keywordMap = buffer . getKeywordMapAtOffset ( caret ) ; String noWordSep = CompleteWord . getNonAlphaNumericWordChars ( buffer , keywordMap , caret ) ; Vector completions = CompleteWord . getCompletions ( buffer , word , keywordMap , noWordSep , caret ) ; if ( ( completions . size ( ) ) == 0 ) dispose ( ) ; words . setListData ( completions ) ; words . setSelectedIndex ( 0 ) ; } break ; default : if ( evt . isActionKey ( ) ) { dispose ( ) ; view . processKeyEvent ( evt ) ; } break ; } } public void keyTyped ( KeyEvent evt ) { } } class MouseHandler extends MouseAdapter { public void mouseClicked ( MouseEvent evt ) { } } }

Fix:
view . getTextArea ( ) . backspace ( ) ;