rem: var cmdchar  = console.prefs["input.commandchar"]; 
context: function con_tabcomplete (e){    var selStart = e.target.selectionStart;    var selEnd   = e.target.selectionEnd;                var v        = e.target.value;    var cmdchar  = console.prefs["input.commandchar"];        if (selStart != selEnd)     {        /* text is highlighted, just move caret to end and exit */        e.target.selectionStart = e.target.selectionEnd = v.length;        return;    }    var firstSpace = v.indexOf(" ");    if (firstSpace == -1)        firstSpace = v.length;    var pfx;    var d;        if ((v[0] == cmdchar) && (selStart <= firstSpace))    {        /* line starts with /, and the cursor is positioned before the         * first space, so we're completing a command         */        var partialCommand = v.substring(1, firstSpace).toLowerCase();        var cmds = console._commands.listNames(partialCommand);        if (!cmds)            /* partial didn't match a thing */            display (getMsg(MSN_NO_CMDMATCH, partialCommand), MT_ERROR);        else if (cmds.length == 1)        {            /* partial matched exactly one command */            pfx = cmdchar + cmds[0];            if (firstSpace == v.length)                v =  pfx + " ";            else                v = pfx + v.substr (firstSpace);                        e.target.value = v;            e.target.selectionStart = e.target.selectionEnd = pfx.length + 1;        }        else if (cmds.length > 1)        {            /* partial matched more than one command */            d = new Date();            if ((d - console._lastTabUp) <= console.prefs["input.dtab.time"])                display (getMsg (MSN_CMDMATCH,                                 [partialCommand, "[" + cmds.join(", ") + "]"]));            else                console._lastTabUp = d;                        pfx = cmdchar + getCommonPfx(cmds);            if (firstSpace == v.length)                v =  pfx;            else                v = pfx + v.substr (firstSpace);                        e.target.value = v;            e.target.selectionStart = e.target.selectionEnd = pfx.length;                    }                    }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/2a8aced6201495747dc0808bddf8bccc67a4f002/venkman-handlers.js/buggy/extensions/venkman/resources/content/venkman-handlers.js