mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
[236458] Fix addition of the last history entry
This commit is contained in:
parent
7b35268500
commit
24abfef5ae
2 changed files with 16 additions and 6 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
|
||||
Bundle-Version: 2.0.0.qualifier
|
||||
Bundle-Version: 2.0.1.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
* 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
|
||||
* Michael Scharf (Wing River) - [236458] Fix 168197 lost the last entry
|
||||
* Martin Oberhuber (Wing River) - [236458] Fix addition of the last history entry
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.control;
|
||||
import java.util.ArrayList;
|
||||
|
@ -18,7 +19,6 @@ 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;
|
||||
|
@ -148,9 +148,19 @@ 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>
|
||||
StringTokenizer tok=new StringTokenizer(history,"\n"); //$NON-NLS-1$
|
||||
while(tok.hasMoreElements())
|
||||
fHistory.add(tok.nextElement());
|
||||
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);
|
||||
}
|
||||
if (i < history.length()) {
|
||||
fHistory.add(history.substring(i));
|
||||
}
|
||||
//</J2ME CDC-1.1 Foundation-1.1 variant>
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue