diff --git a/common/locale/en-US/messages.properties b/common/locale/en-US/messages.properties index 63d1a130..88779c3d 100644 --- a/common/locale/en-US/messages.properties +++ b/common/locale/en-US/messages.properties @@ -94,6 +94,7 @@ command.let.undefinedVar-1 = E121: Undefined variable: %S command.let.unexpectedChar = E18: Unexpected characters in :let command.run.noPrevious = E34: No previous command 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.numberRequired-2 = E521: Number required after =: %S=%S command.set.unknownOption-1 = E518: Unknown option: %S diff --git a/common/modules/io.jsm b/common/modules/io.jsm index bd7b955a..f5af1188 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -783,9 +783,13 @@ unlet s:cpo_save commands.add(["scrip[tnames]"], "List all sourced script names", function () { - modules.commandline.commandOutput( - template.tabular(["", "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? + if (!io._scriptNames.length) + dactyl.echomsg(_("command.scriptnames.none")); + else + modules.commandline.commandOutput( + template.tabular(["", "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" });