Viewing Issue Advanced Details

ID 0003883 Category [DMDirc] User Interface - Input and tab completion Severity minor
Reproducibility always Date Submitted 2010-03-08 21:24 Last Update 2010-03-20 12:38
Reporter MD87 Assigned To Demented-Idiot View Status public
Priority normal Status resolved Resolution fixed
Platform Fixed in Version Target Version 0.6.4
Product Version Product Build
Summary 0003883: mIRC style completion needs to play nicer with changing tab completion suggestions
Description
mIRC style completion needs to play nicer with changing tab completion suggestions
Needs unit test no
Upstream Bug URL

Relationships

Notes

A patchset (1) related to this change has been added to gerrit by Simon Mott

mIRC tab completer does not cache results.

fixes issue 3883

Change-Id: Id6dc34d0dabb763a8ac03ef20ee66fd9caf6d8eb

A patchset (2) related to this change has been added to gerrit by Simon Mott

mIRC tab completer does not cache results.

fixes issue 3883

Change-Id: Id6dc34d0dabb763a8ac03ef20ee66fd9caf6d8eb
authorSimon Mott <simon@dmdirc.com>2010-03-18 01:45:16 (GMT)
committer Gregory Holmes <greg@dmdirc.com>2010-03-20 12:37:47 (GMT)
commita24dbcff2bad7050aad7e72c854834e868c4d05b (patch) (side-by-side diff)
mIRC tab completer does not cache results.
fixes issue 3883 Change-Id: Id6dc34d0dabb763a8ac03ef20ee66fd9caf6d8eb Reviewed-on: http://gerrit.dmdirc.com/1110 Reviewed-by: Gregory Holmes <greg@dmdirc.com> Reviewed-by: Shane Mc Cormack <shane@dmdirc.com> Reviewed-by: Chris Smith <chris@dmdirc.com> Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
-rw-r--r--src/com/dmdirc/addons/tabcompletion_mirc/MircStyle.java16
1 files changed, 9 insertions, 7 deletions
Click to Expand/Collapse
diff src/com/dmdirc/addons/tabcompletion_mirc/MircStyle.java
@@ -32,15 +32,14 @@ import com.dmdirc.ui.interfaces.InputWindow;
import java.awt.Toolkit;
import java.util.Collections;
-import java.util.List;
public class MircStyle implements TabCompletionStyle {
- /** The last set of results we retrieved. */
- private List<String> lastResult;
-
/** The last word that was tab completed. */
private String lastWord;
+
+ /** The last string we tried to tab complete. */
+ private String tabString;
/** The tab completer that we use. */
protected final TabCompleter tabCompleter;
@@ -68,9 +67,12 @@ public class MircStyle implements TabCompletionStyle {
final String word = original.substring(start, end);
String target = "";
if (word.equals(lastWord)) {
+ final TabCompleterResult res = tabCompleter.complete(tabString, additional);
+ Collections.sort(res.getResults(), String.CASE_INSENSITIVE_ORDER);
// We're continuing to tab through
- target = lastResult.get((lastResult.indexOf(lastWord) +
- (shiftPressed ? -1 : 1) + lastResult.size()) % lastResult.size());
+ target = res.getResults().get((res.getResults().indexOf(lastWord) +
+ (shiftPressed ? -1 : 1) + res.getResults().size()) % res
+ .getResults().size());
} else {
// New tab target
final TabCompleterResult res = tabCompleter.complete(word, additional);
@@ -88,7 +90,7 @@ public class MircStyle implements TabCompletionStyle {
} else {
target = res.getResults().get(0);
}
- lastResult = res.getResults();
+ tabString = word;
}
}

Issue History

Date Modified Username Field Change
2010-03-08 21:24 MD87 New Issue
2010-03-08 21:24 MD87 Status new => assigned
2010-03-08 21:24 MD87 Assigned To => MD87
2010-03-10 18:20 MD87 Assigned To MD87 => Demented-Idiot
2010-03-10 21:48 Version Control Checkin
2010-03-10 21:48 Version Control Note Added: 0010286
2010-03-10 21:48 Version Control Status assigned => fix pending
2010-03-11 00:43 MD87 Needs unit test => no
2010-03-11 00:43 MD87 Status fix pending => assigned
2010-03-11 01:00 Demented-Idiot Note Deleted: 0010286
2010-03-11 01:04 Demented-Idiot Category *Unsorted => User Interface - Input and tab completion
2010-03-18 01:45 Demented-Idiot Checkin
2010-03-18 01:45 Demented-Idiot Note Added: 0010584
2010-03-18 01:45 Demented-Idiot Status assigned => fix pending
2010-03-18 01:57 Demented-Idiot Checkin
2010-03-18 01:57 Demented-Idiot Note Added: 0010585
2010-03-20 12:38 Demented-Idiot Checkin
2010-03-20 12:38 Demented-Idiot Note Added: 0010635
2010-03-20 12:38 Demented-Idiot Status fix pending => resolved
2010-03-20 12:38 Demented-Idiot Resolution open => fixed