aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/args.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-20 15:29:03 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-20 15:29:03 -0400
commit03c4016d07477781aa3adcc9edf340c0bec9c6c8 (patch)
treed3be089e9020807326a4e56562876ecb7bcf7892 /core/args.lua
parentb682fbd4a6e53185e2556686079532ad0e42be94 (diff)
Code cleanup.
Of note: * io.save_all_files() does not visit each buffer to save anymore. An unintended side-effect was checking for outside modification (but only if the file itself was modified), so outside changes will always be saved over now. * The menu clicked handler uses assert_type(), so the 'Unknown command' localization is no longer needed. * When printing to a new buffer type would split the view, use an existing split view when possible. * Prefer 'goto continue' construct in loops over nested 'if's. * Fixed clearing of ui.find.replace_entry_text on reset in the GUI version. * Fixed lack of statusbar updating when setting options like buffer EOL mode, indentation, and encoding. * Renamed internal new_snippet() to new() and put it in the snippet metatable.
Diffstat (limited to 'core/args.lua')
-rw-r--r--core/args.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/args.lua b/core/args.lua
index 3d249c9a..af605d36 100644
--- a/core/args.lua
+++ b/core/args.lua
@@ -11,7 +11,7 @@ module('args')]]
events.ARG_NONE = 'arg_none'
--- Contains registered command line options.
+-- Map of registered command line options.
-- @class table
-- @name options
local options = {}
@@ -44,6 +44,8 @@ end
-- Emits an `ARG_NONE` event when no arguments are present unless
-- *no_emit_arg_none* is `true`.
-- @param arg Argument table.
+-- @param no_emit_arg_none When `true`, do not emit `ARG_NONE` when no arguments
+-- are present. The default value is `false`.
-- @see register
-- @see _G.events
local function process(arg, no_emit_arg_none)
@@ -135,7 +137,7 @@ M.register('-t', '--test', 1, function(patterns)
local arg = {}
for patt in (patterns or ''):gmatch('[^,]+') do arg[#arg + 1] = patt end
local env = setmetatable({arg = arg}, {__index = _G})
- assert(loadfile(_HOME..'/test/test.lua', 't', env))()
+ assert(loadfile(_HOME .. '/test/test.lua', 't', env))()
end)
end, 'Runs unit tests indicated by comma-separated list of patterns (or all)')