1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-13 03:55:22 +02:00

RESOLVED - bug 236458: [terminal] CommandInputFieldWithHistory.setHistory misses the last hisory entry

https://bugs.eclipse.org/bugs/show_bug.cgi?id=236458
This commit is contained in:
Michael Scharf 2008-06-11 00:43:28 +00:00
parent 5f087d7ec4
commit c45fabd1c0

View file

@ -10,6 +10,7 @@
* Michael Scharf (Wing River) - [211659] Add field assist to terminal input field
* Michael Scharf (Wing River) - [196447] The optional terminal input line should be resizeable
* Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
* Michael Scharf (Wing River) - [236458] Fix 168197 lost the last entry
*******************************************************************************/
package org.eclipse.tm.internal.terminal.control;
import java.util.ArrayList;
@ -17,6 +18,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
@ -146,16 +148,9 @@ public class CommandInputFieldWithHistory implements ICommandInputField {
// add history entries separated by '\n'
// fHistory.addAll(Arrays.asList(history.split("\n"))); //$NON-NLS-1$
//<J2ME CDC-1.1 Foundation-1.1 variant>
int i = 0;
int j = history.indexOf('\n');
while (j > i) {
fHistory.add(history.substring(i, j));
do {
j++;
} while (j < history.length() && history.charAt(j) == '\n');
i = j;
j = history.indexOf('\n', i);
}
StringTokenizer tok=new StringTokenizer(history,"\n"); //$NON-NLS-1$
while(tok.hasMoreElements())
fHistory.add(tok.nextElement());
//</J2ME CDC-1.1 Foundation-1.1 variant>
}
/**