1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 21:07:59 +01:00

Display a message from :scriptnames when no scripts have been sourced.

This commit is contained in:
Doug Kearns
2011-04-04 22:11:30 +10:00
parent 8ef77adb1c
commit d960ede32e
2 changed files with 8 additions and 3 deletions

View File

@@ -94,6 +94,7 @@ command.let.undefinedVar-1 = E121: Undefined variable: %S
command.let.unexpectedChar = E18: Unexpected characters in :let command.let.unexpectedChar = E18: Unexpected characters in :let
command.run.noPrevious = E34: No previous command command.run.noPrevious = E34: No previous command
command.sanitize.privateMode = Cannot sanitize items in private mode command.sanitize.privateMode = Cannot sanitize items in private mode
command.scriptnames.none = No sourced scripts found
command.set.errorParsing-1 = Error parsing :set command: %S command.set.errorParsing-1 = Error parsing :set command: %S
command.set.numberRequired-2 = E521: Number required after =: %S=%S command.set.numberRequired-2 = E521: Number required after =: %S=%S
command.set.unknownOption-1 = E518: Unknown option: %S command.set.unknownOption-1 = E518: Unknown option: %S

View File

@@ -783,9 +783,13 @@ unlet s:cpo_save
commands.add(["scrip[tnames]"], commands.add(["scrip[tnames]"],
"List all sourced script names", "List all sourced script names",
function () { function () {
modules.commandline.commandOutput( if (!io._scriptNames.length)
template.tabular(["<SNR>", "Filename"], ["text-align: right; padding-right: 1em;"], dactyl.echomsg(_("command.scriptnames.none"));
([i + 1, file] for ([i, file] in Iterator(io._scriptNames))))); // TODO: add colon and remove column titles for pedantic Vim compatibility? else
modules.commandline.commandOutput(
template.tabular(["<SNR>", "Filename"], ["text-align: right; padding-right: 1em;"],
([i + 1, file] for ([i, file] in Iterator(io._scriptNames))))); // TODO: add colon and remove column titles for pedantic Vim compatibility?
}, },
{ argCount: "0" }); { argCount: "0" });