From 20519d88db14006090c6a58848a7be7785821e24 Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Thu, 29 May 2014 22:10:16 +0100 Subject: [PATCH] fix tab completion for /jsp command --- docs/release-notes.md | 6 ++++++ src/main/js/lib/tabcomplete-jsp.js | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 378b472..e456288 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,3 +1,9 @@ +# 2014 05 29 +Fix tab completion for /jsp command so that it conforms with tab completion norms in minecraft. +/jsp ice completes to /jsp icecream +Hitting TAB again has no effect. Player must type space then hit TAB to get list of flavors. +This is consistent with how MC treats other commands for tab completion. + # 2014 05 19 Improved Tab Completion to work with Java Enums too. diff --git a/src/main/js/lib/tabcomplete-jsp.js b/src/main/js/lib/tabcomplete-jsp.js index 3ed61cb..d3cd1f1 100644 --- a/src/main/js/lib/tabcomplete-jsp.js +++ b/src/main/js/lib/tabcomplete-jsp.js @@ -13,11 +13,7 @@ var __onTabCompleteJSP = function( result, cmdSender, pluginCmd, cmdAlias, cmdAr if ( cmd ) { opts = cmd.options; len = opts.length; - if ( cmdArgs.length == 1 ) { - for ( i = 0; i < len; i++ ) { - result.add( opts[i] ); - } - } else { + if ( cmdArgs.length > 1 ) { // partial e.g. /jsp chat_color dar for ( i = 0; i < len; i++ ) { if ( opts[i].indexOf( cmdArgs[1] ) == 0 ) {