From 03c4016d07477781aa3adcc9edf340c0bec9c6c8 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Tue, 20 Oct 2020 15:29:03 -0400 Subject: 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. --- core/args.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/args.lua') 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)') -- cgit v1.2.3