Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Fix indentation #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions jquery.console.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,14 @@
};

function clearCurrentPrompt() {
extern.promptText("");
extern.promptText("");
};

function clearScreen() {
inner.children(".jquery-console-prompt-box, .jquery-console-message").remove();
extern.report(" ");
extern.promptText("");
extern.focus();
inner.children(".jquery-console-prompt-box, .jquery-console-message").remove();
extern.report(" ");
extern.promptText("");
extern.focus();
};

function deleteNextWord() {
Expand Down Expand Up @@ -684,11 +684,11 @@
};

function doComplete() {
if(typeof config.completeHandle == 'function') {
doCompleteDirectly();
} else {
issueComplete();
}
if(typeof config.completeHandle == 'function') {
doCompleteDirectly();
} else {
issueComplete();
}
};

function doCompleteDirectly() {
Expand Down Expand Up @@ -725,43 +725,43 @@
}
};

function issueComplete() {
if (typeof config.completeIssuer == 'function') {
config.completeIssuer(promptText);
}
};

function showCompletion(promptText, completions) {

var len = completions.length;
if (len === 1) {
extern.promptText(promptText + completions[0]);
} else if (len > 1 && config.cols) {
var prompt = promptText;
// Compute the number of rows that will fit in the width
var max = 0;
for (var i = 0; i < len; i++) {
max = Math.max(max, completions[i].length);
}
max += 2;
var n = Math.floor(config.cols / max);
var buffer = "";
var col = 0;
for (i = 0; i < len; i++) {
var completion = completions[i];
buffer += completions[i];
for (var j = completion.length; j < max; j++) {
buffer += " ";
}
if (++col >= n) {
buffer += "\n";
col = 0;
}
}
commandResult(buffer, "jquery-console-message-value");
extern.promptText(prompt);
}
};
function issueComplete() {
if (typeof config.completeIssuer == 'function') {
config.completeIssuer(promptText);
}
};

function showCompletion(promptText, completions) {

var len = completions.length;
if (len === 1) {
extern.promptText(promptText + completions[0]);
} else if (len > 1 && config.cols) {
var prompt = promptText;
// Compute the number of rows that will fit in the width
var max = 0;
for (var i = 0; i < len; i++) {
max = Math.max(max, completions[i].length);
}
max += 2;
var n = Math.floor(config.cols / max);
var buffer = "";
var col = 0;
for (i = 0; i < len; i++) {
var completion = completions[i];
buffer += completions[i];
for (var j = completion.length; j < max; j++) {
buffer += " ";
}
if (++col >= n) {
buffer += "\n";
col = 0;
}
}
commandResult(buffer, "jquery-console-message-value");
extern.promptText(prompt);
}
};

function doNothing() {};

Expand Down