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. --- modules/textadept/init.lua | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'modules/textadept/init.lua') diff --git a/modules/textadept/init.lua b/modules/textadept/init.lua index 435b34dd..0195ae31 100644 --- a/modules/textadept/init.lua +++ b/modules/textadept/init.lua @@ -9,19 +9,11 @@ textadept = M -- forward declaration -- It provides utilities for editing text in Textadept. module('textadept')]] -M.bookmarks = require('textadept.bookmarks') -require('textadept.command_entry') -M.editing = require('textadept.editing') -M.file_types = require('textadept.file_types') -require('textadept.find') -M.history = require('textadept.history') -M.macros = require('textadept.macros') -M.run = require('textadept.run') -M.session = require('textadept.session') -M.snippets = require('textadept.snippets') - --- These need to be loaded last. -M.menu = require('textadept.menu') -M.keys = require('textadept.keys') +local modules = { + 'bookmarks', 'command_entry', 'editing', 'file_types', 'find', 'history', + 'macros', 'run', 'session', 'snippets', --[[need to be last]] 'menu', 'keys' +} +for _, name in ipairs(modules) do M[name] = require('textadept.' .. name) end +M.command_entry, M.find = nil, nil -- ui.command_entry, ui.find return M -- cgit v1.2.3