Browse Source

/join now has an option to complete existing chans

commands.join-tabexistingchannels will toggle tab completion for channels that
the user is already in. Defaults to false as most users will just use /join
for joining, not for trying to focus existing windows.

Fixes issue 4092

Change-Id: Ie5c260b202ff8617a28edb90838e4b6a57b7f326
Reviewed-on: http://gerrit.dmdirc.com/1201
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4rc1
Chris Smith 14 years ago
parent
commit
0ef9552b40

+ 9
- 4
src/com/dmdirc/commandparser/commands/server/JoinChannelCommand.java View File

@@ -144,10 +144,15 @@ public final class JoinChannelCommand extends ServerCommand implements
144 144
             prefix = "";
145 145
         }
146 146
 
147
-        for (String result : results) {
148
-            // Only tab complete channels we're not already on
149
-            if (!server.hasChannel(result)) {
150
-                targets.add(prefix + result);
147
+        final boolean showExisting = source.getConfigManager()
148
+                .getOptionBool("commands", "join-tabexistingchannels");
149
+
150
+        if (!showExisting) {
151
+            for (String result : results) {
152
+                // Only tab complete channels we're not already on
153
+                if (!server.hasChannel(result)) {
154
+                    targets.add(prefix + result);
155
+                }
151 156
             }
152 157
         }
153 158
 

Loading…
Cancel
Save