1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-24 08:15:45 +01:00

-TODO: :<Tab> leaves the cursor at the head of the line

This commit is contained in:
Kris Maglione
2008-12-02 09:03:45 +00:00
parent 3671422a3b
commit 4336e740a7
3 changed files with 9 additions and 15 deletions

View File

@@ -169,17 +169,10 @@ function CommandLine() //{{{
if (full)
{
if (event.shiftKey)
{
completionIndex--;
if (completionIndex < -1)
completionIndex = completions.items.length - 1;
}
else
{
completionIndex++;
if (completionIndex > completions.items.length)
completionIndex = 0;
}
completionIndex = Math.max(0, Math.min(completions.items.length - 1, completionIndex));
statusTimer.tell();
}
@@ -209,7 +202,8 @@ function CommandLine() //{{{
previewClear();
let editor = commandWidget.inputField.editor;
editor.selection.focusNode.textContent = command.substring(0, completions.start) + compl + completionPostfix;
commandWidget.value = command.substring(0, completions.start) + compl + completionPostfix;
editor.selection.focusNode.textContent = commandWidget.value;
let range = editor.selection.getRangeAt(0);
range.setStart(range.startContainer, completions.start + compl.length);