1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Scroll to bottom of console after inputting command

This commit is contained in:
Laurent Cozic 2017-10-24 22:09:22 +01:00
parent 528f1b0430
commit 89d85541ef
8 changed files with 24 additions and 5 deletions

View File

@ -259,7 +259,7 @@ class AppGui {
}
addCommandToConsole(cmd) {
this.stdout(chalk.cyan.bold('> ' + cmd));
this.stdout(chalk.cyan.bold('> ' + cmd));
}
setupShortcuts() {
@ -524,6 +524,8 @@ class AppGui {
} catch (error) {
this.stdout(error.message);
}
this.widget('console').scrollBottom();
}
async updateFolderList() {

View File

@ -56,6 +56,7 @@ class Command extends BaseCommand {
this.stdout(commandNames.join(', '));
this.stdout('');
this.stdout(_('To move from one widget to another, press Tab or Shift+Tab.'));
this.stdout(_('Use the arrows and page up/down to scroll the lists and text areas (including this console).'));
this.stdout(_('To maximise/minimise the console, press "C".'));
this.stdout(_('To enter command line mode, press ":"'));
this.stdout(_('To exit command line mode, press ESCAPE'));

View File

@ -116,8 +116,10 @@ class StatusBarWidget extends BaseWidget {
if (input === undefined) {
// User cancel
} else {
resolveResult = input;
if (input && input.trim() != '') this.history_.push(input);
resolveResult = input ? input.trim() : input;
// Add the command to history but only if it's longer than one character.
// Below that it's usually an answer like "y"/"n", etc.
if (input && input.length > 1) this.history_.push(input);
}
}

View File

@ -77,7 +77,7 @@ function renderCommandHelp(cmd, width = null) {
if (defaultString !== null) desc.push(_('Default: %s', defaultString));
return [md.key, desc.join('\n')];
return [md.key, desc.join("\n")];
};
output.push('');

View File

@ -253,6 +253,11 @@ msgstr ""
msgid "To move from one widget to another, press Tab or Shift+Tab."
msgstr ""
msgid ""
"Use the arrows and page up/down to scroll the lists and text area (including "
"the console)."
msgstr ""
msgid "To maximise/minimise the console, press \"C\"."
msgstr ""

View File

@ -280,6 +280,11 @@ msgstr ""
msgid "To move from one widget to another, press Tab or Shift+Tab."
msgstr ""
msgid ""
"Use the arrows and page up/down to scroll the lists and text area (including "
"the console)."
msgstr ""
#, fuzzy
msgid "To maximise/minimise the console, press \"C\"."
msgstr "Quitter le logiciel."

View File

@ -253,6 +253,11 @@ msgstr ""
msgid "To move from one widget to another, press Tab or Shift+Tab."
msgstr ""
msgid ""
"Use the arrows and page up/down to scroll the lists and text area (including "
"the console)."
msgstr ""
msgid "To maximise/minimise the console, press \"C\"."
msgstr ""

View File

@ -212,7 +212,6 @@ class Setting extends BaseModel {
static enumOptionsDoc(key, templateString = null) {
if (templateString === null) templateString = '%s: %s';
console.info(templateString);
const options = this.enumOptions(key);
let output = [];
for (let n in options) {