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 ) {