[polari] ircParser: Trim trailing whitespace from commands



commit 9bbb16bb397c6da54bf294292601b52067ca2743
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 18 00:17:17 2016 +0100

    ircParser: Trim trailing whitespace from commands
    
    The command tab-completion added in commit 68758eaf1 appends a space
    after the inserted command, which makes sense for commands that take
    parameters, but currently breaks those that don't - it is rather silly
    to treat "/help " as anything other than "/help" though, so simply
    strip trailing whitespace.

 src/ircParser.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/ircParser.js b/src/ircParser.js
index 88a468c..db07b04 100644
--- a/src/ircParser.js
+++ b/src/ircParser.js
@@ -79,7 +79,7 @@ const IrcParser = new Lang.Class({
 
         let retval = true;
 
-        let argv = text.substr(1).split(/ +/);
+        let argv = text.trimRight().substr(1).split(/ +/);
         let cmd = argv.shift().toUpperCase();
         let output = null;
         switch (cmd) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]