From c569b3b3697c1656c78ec4b4d233d4ed78fa898a Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 5 Dec 2021 22:44:43 -0500 Subject: Bumping versions. --- plugins/spellcheck.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 7b0ba2b..b0626a9 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -1,4 +1,4 @@ --- mod-version:2 -- lite-xl 2.0 +-- mod-version:3 --lite-xl 2.1 local core = require "core" local style = require "core.style" local config = require "core.config" -- cgit v1.2.3 From 3fcf065be6387c5bb38a46924f5ea1a7bb17850d Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 5 Dec 2021 22:56:04 -0500 Subject: Appropriately merged config hashes. --- plugins/autoinsert.lua | 5 +++-- plugins/autosave.lua | 3 ++- plugins/autowrap.lua | 2 +- plugins/bigclock.lua | 4 ++-- plugins/datetimestamps.lua | 5 +++-- plugins/fontconfig.lua | 3 ++- plugins/indent_convert.lua | 5 +++-- plugins/lfautoinsert.lua | 4 ++-- plugins/minimap.lua | 4 ++-- plugins/motiontrail.lua | 3 ++- plugins/openfilelocation.lua | 15 ++++++++------- plugins/openselected.lua | 16 +++++++++------- plugins/scalestatus.lua | 4 ++-- plugins/smoothcaret.lua | 3 ++- plugins/spellcheck.lua | 12 ++++-------- plugins/statusclock.lua | 5 +++-- 16 files changed, 50 insertions(+), 43 deletions(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/autoinsert.lua b/plugins/autoinsert.lua index d0b8404..dd126c8 100644 --- a/plugins/autoinsert.lua +++ b/plugins/autoinsert.lua @@ -2,19 +2,20 @@ local core = require "core" local translate = require "core.doc.translate" local config = require "core.config" +local common = require "core.common" local DocView = require "core.docview" local command = require "core.command" local keymap = require "core.keymap" -config.plugins.autoinsert = { map = { +config.plugins.autoinsert = common.merge({ map = { ["["] = "]", ["{"] = "}", ["("] = ")", ['"'] = '"', ["'"] = "'", ["`"] = "`", -} } +} }, config.plugins.autoinsert) local function is_closer(chr) diff --git a/plugins/autosave.lua b/plugins/autosave.lua index 8c79e8d..34d2ad6 100644 --- a/plugins/autosave.lua +++ b/plugins/autosave.lua @@ -3,13 +3,14 @@ local core = require "core" local config = require "core.config" local Doc = require "core.doc" local command = require "core.command" +local common = require "core.common" -- this is used to detect the wait time local last_keypress = os.time() -- this exists so that we don't end up with multiple copies of the loop running at once local looping = false local on_text_change = Doc.on_text_change -- the approximate amount of time, in seconds, that it takes to trigger an autosave -config.plugins.autosave = { timeout = 1 } +config.plugins.autosave = common.merge({ timeout = 1 }, config.plugins.autosave) local function loop_for_save() diff --git a/plugins/autowrap.lua b/plugins/autowrap.lua index a44094a..0f34eec 100644 --- a/plugins/autowrap.lua +++ b/plugins/autowrap.lua @@ -4,7 +4,7 @@ local config = require "core.config" local command = require "core.command" local DocView = require "core.docview" -config.plugins.autowrap = { files = { "%.md$", "%.txt$" } } +config.plugins.autowrap = common.merge({ files = { "%.md$", "%.txt$" } }, config.plugins.autowrap) local on_text_input = DocView.on_text_input diff --git a/plugins/bigclock.lua b/plugins/bigclock.lua index 82c3fe4..a7b4958 100644 --- a/plugins/bigclock.lua +++ b/plugins/bigclock.lua @@ -7,11 +7,11 @@ local config = require "core.config" local View = require "core.view" -config.plugins.bigclock = { +config.plugins.bigclock = common.merge({ time_format = "%H:%M:%S", date_format = "%A, %d %B %Y", scale = 1 -} +}, config.plugins.bigclock) local ClockView = View:extend() diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index c08547f..bd208f7 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -2,6 +2,7 @@ local core = require "core" local config = require "core.config" local command = require "core.command" +local common = require "core.common" --[[ Date and time format placeholders @@ -25,11 +26,11 @@ from https://www.lua.org/pil/22.1.html %y two-digit year (98) [00-99] %% the character `%´ --]] -config.plugins.datetimestamps = { +config.plugins.datetimestamps = common.merge({ format_datestamp = "%Y%m%d" format_datetimestamp = "%Y%m%d_%H%M%S" format_timestamp = "%H%M%S" -} +}, config.plugins.datetimestamps) local function datestamp() local sOut = os.date(config.plugins.datetimestamps.format_datestamp) diff --git a/plugins/fontconfig.lua b/plugins/fontconfig.lua index 11e7fca..6b1047c 100644 --- a/plugins/fontconfig.lua +++ b/plugins/fontconfig.lua @@ -4,8 +4,9 @@ local subprocess = require "process" local core = require "core" local style = require "core.style" local config = require "core.config" +local common = require "core.common" -config.plugins.fontconfig = { prefix = "" } +config.plugins.fontconfig = common.merge({ prefix = "" }, config.plugins.fontconfig) --[[ Example config (put it in user module): diff --git a/plugins/indent_convert.lua b/plugins/indent_convert.lua index 3c22867..2442b39 100644 --- a/plugins/indent_convert.lua +++ b/plugins/indent_convert.lua @@ -1,11 +1,12 @@ -- mod-version:3 --lite-xl 2.1 local core = require "core" +local common = require "core.common" local config = require "core.config" local command = require "core.command" -config.plugins.indent_convert = { +config.plugins.indent_convert = common.merge({ update_indent_type = true -- set to false to avoid updating the document indent type -} +}, config.plugins.indent_convert) local zero_pattern = _VERSION == "Lua 5.1" and "%z" or "\0" diff --git a/plugins/lfautoinsert.lua b/plugins/lfautoinsert.lua index bc3c460..138f48f 100644 --- a/plugins/lfautoinsert.lua +++ b/plugins/lfautoinsert.lua @@ -5,7 +5,7 @@ local common = require "core.common" local config = require "core.config" local keymap = require "core.keymap" -config.plugins.lfautoinsert = { map = { +config.plugins.lfautoinsert = common.merge({ map = { ["{%s*\n"] = "}", ["%(%s*\n"] = ")", ["%f[[]%[%s*\n"] = "]", @@ -37,7 +37,7 @@ config.plugins.lfautoinsert = { map = { ["%[%[%s*\n"] = "]]" } }, -} } +} }, config.plugins.lfautoinsert) local function get_autoinsert_map(filename) local map = {} diff --git a/plugins/minimap.lua b/plugins/minimap.lua index 7bf0a92..977e2ee 100644 --- a/plugins/minimap.lua +++ b/plugins/minimap.lua @@ -8,7 +8,7 @@ local DocView = require "core.docview" local Object = require "core.object" -- General plugin settings -config.plugins.minimap = { +config.plugins.minimap = common.merge({ enabled = true, width = 100, instant_scroll = false, @@ -39,7 +39,7 @@ config.plugins.minimap = { -- config.plugins.minimap.highlight_align = 'right' -- config.plugins.minimap.highlight_width = 5 -- config.plugins.minimap.gutter_width = 0 -} +}, config.plugins.minimap) -- Configure size for rendering each char in the minimap local char_height = 1 * SCALE * config.plugins.minimap.scale diff --git a/plugins/motiontrail.lua b/plugins/motiontrail.lua index 4ed99ae..112e1cd 100644 --- a/plugins/motiontrail.lua +++ b/plugins/motiontrail.lua @@ -1,10 +1,11 @@ -- mod-version:3 --lite-xl 2.1 local core = require "core" local config = require "core.config" +local common = require "core.common" local style = require "core.style" local DocView = require "core.docview" -config.plugins.motiontrail = { steps = 50 } +config.plugins.motiontrail = common.merge({ steps = 50 }, config.plugins.motiontrail) local function lerp(a, b, t) diff --git a/plugins/openfilelocation.lua b/plugins/openfilelocation.lua index b16ee82..0328142 100644 --- a/plugins/openfilelocation.lua +++ b/plugins/openfilelocation.lua @@ -5,15 +5,16 @@ local config = require "core.config" config.plugins.openfilelocation = {} -if PLATFORM == "Windows" then - config.plugins.openfilelocation.filemanager = "explorer" -elseif PLATFORM == "Mac OS X" then - config.plugins.openfilelocation.filemanager = "open" -else - config.plugins.openfilelocation.filemanager = "xdg-open" +if not config.plugins.openfilelocation.filemanager then + if PLATFORM == "Windows" then + config.plugins.openfilelocation.filemanager = "explorer" + elseif PLATFORM == "Mac OS X" then + config.plugins.openfilelocation.filemanager = "open" + else + config.plugins.openfilelocation.filemanager = "xdg-open" + end end - command.add("core.docview", { ["open-file-location:open-file-location"] = function() local doc = core.active_view.doc diff --git a/plugins/openselected.lua b/plugins/openselected.lua index 0a7a58a..02312b5 100644 --- a/plugins/openselected.lua +++ b/plugins/openselected.lua @@ -2,19 +2,21 @@ local core = require "core" local command = require "core.command" local keymap = require "core.keymap" +local common = require "core.common" local config = require "core.config" config.plugins.openselected = {} -if PLATFORM == "Windows" then - config.plugins.openselected.filemanager = "start" -elseif PLATFORM == "Mac OS X" then - config.plugins.openselected.filemanager = "open" -else - config.plugins.openselected.filemanager = "xdg-open" +if not config.plugins.openselected.filemanager then + if PLATFORM == "Windows" then + config.plugins.openselected.filemanager = "start" + elseif PLATFORM == "Mac OS X" then + config.plugins.openselected.filemanager = "open" + else + config.plugins.openselected.filemanager = "xdg-open" + end end - command.add("core.docview", { ["open-selected:open-selected"] = function() local doc = core.active_view.doc diff --git a/plugins/scalestatus.lua b/plugins/scalestatus.lua index 09b62fd..008feaf 100644 --- a/plugins/scalestatus.lua +++ b/plugins/scalestatus.lua @@ -6,11 +6,11 @@ originally by SwissalpS --]] local scale = require "plugins.scale" - +local common = require "core.common" local config = require "core.config" local StatusView = require "core.statusview" -config.plugins.scalestatus = { format = '%.0f%%' } +config.plugins.scalestatus = common.merge({ format = '%.0f%%' }, config.plugins.scalestatus) local get_items = StatusView.get_items function StatusView:get_items() diff --git a/plugins/smoothcaret.lua b/plugins/smoothcaret.lua index 2c05664..335dd08 100644 --- a/plugins/smoothcaret.lua +++ b/plugins/smoothcaret.lua @@ -2,9 +2,10 @@ local core = require "core" local config = require "core.config" local style = require "core.style" +local common = require "core.common" local DocView = require "core.docview" -config.plugins.smoothcaret = { rate = 0.65 } +config.plugins.smoothcaret = common.merge({ rate = 0.65 }, config.plugins.smoothcaret) local docview_update = DocView.update function DocView:update() diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index b0626a9..190087a 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -7,14 +7,10 @@ local common = require "core.common" local DocView = require "core.docview" local Doc = require "core.doc" -config.plugins.spellcheck = {} -config.plugins.spellcheck.files = { "%.txt$", "%.md$", "%.markdown$" } -if PLATFORM == "Windows" then - config.plugins.spellcheck.dictionary_file = EXEDIR .. "/words.txt" -else - config.plugins.spellcheck.dictionary_file = "/usr/share/dict/words" -end - +config.plugins.spellcheck = common.merge({ + files = { "%.txt$", "%.md$", "%.markdown$" }, + dictionary_file = (PLATFORM == "Windows" and EXEDIR .. "/words.txt" or "/usr/share/dict/words") +}, config.plugins.spellcheck) local last_input_time = 0 local word_pattern = "%a+" diff --git a/plugins/statusclock.lua b/plugins/statusclock.lua index a2155df..139ae23 100644 --- a/plugins/statusclock.lua +++ b/plugins/statusclock.lua @@ -2,13 +2,14 @@ local core = require "core" local config = require "core.config" local style = require "core.style" +local common = require "core.common" local StatusView = require "core.statusview" local scan_rate = 1 -config.plugins.statusclock = { +config.plugins.statusclock = common.merge({ time_format = "%H:%M:%S", date_format = "%A, %d %B %Y" -} +}, config.plugins.statusclock) local time_data = { time_text = '', -- cgit v1.2.3 From 198252c258b3313d941ce9d53c6ed73430bf811d Mon Sep 17 00:00:00 2001 From: jgmdev Date: Fri, 11 Mar 2022 05:12:10 -0400 Subject: spellcheck: added context menu --- plugins/spellcheck.lua | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 190087a..30e16c9 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -9,7 +9,9 @@ local Doc = require "core.doc" config.plugins.spellcheck = common.merge({ files = { "%.txt$", "%.md$", "%.markdown$" }, - dictionary_file = (PLATFORM == "Windows" and EXEDIR .. "/words.txt" or "/usr/share/dict/words") + dictionary_file = PLATFORM == "Windows" + and EXEDIR .. "/words.txt" + or "/usr/share/dict/words" }, config.plugins.spellcheck) local last_input_time = 0 @@ -28,7 +30,10 @@ core.add_thread(function() end words = t core.redraw = true - core.log_quiet("Finished loading dictionary file: \"%s\"", config.plugins.spellcheck.dictionary_file) + core.log_quiet( + "Finished loading dictionary file: \"%s\"", + config.plugins.spellcheck.dictionary_file + ) end) @@ -60,8 +65,11 @@ local draw_line_text = DocView.draw_line_text function DocView:draw_line_text(idx, x, y) draw_line_text(self, idx, x, y) - if not words - or not matches_any(self.doc.filename or "", config.plugins.spellcheck.files) then + if + not words + or + not matches_any(self.doc.filename or "", config.plugins.spellcheck.files) + then return end @@ -175,3 +183,10 @@ command.add("core.docview", { end, }) + +local contextmenu = require "plugins.contextmenu" +contextmenu:register("core.docview", { + contextmenu.DIVIDER, + { text = "View Suggestions", command = "spell-check:replace" }, + { text = "Add to Dictionary", command = "spell-check:add-to-dictionary" } +}) -- cgit v1.2.3 From fb40e73fcd01e044ac6c8b9d9fee1230d7a98c93 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Fri, 11 Mar 2022 07:14:43 -0400 Subject: spellcheck: added toggle command --- plugins/spellcheck.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 30e16c9..566bd3e 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -8,6 +8,7 @@ local DocView = require "core.docview" local Doc = require "core.doc" config.plugins.spellcheck = common.merge({ + enable = true, files = { "%.txt$", "%.md$", "%.markdown$" }, dictionary_file = PLATFORM == "Windows" and EXEDIR .. "/words.txt" @@ -66,6 +67,8 @@ function DocView:draw_line_text(idx, x, y) draw_line_text(self, idx, x, y) if + not config.plugins.spellcheck.enable + or not words or not matches_any(self.doc.filename or "", config.plugins.spellcheck.files) @@ -118,6 +121,10 @@ end command.add("core.docview", { + ["spell-check:toggle"] = function() + config.plugins.spellcheck.enable = not config.plugins.spellcheck.enable + end, + ["spell-check:add-to-dictionary"] = function() local word = get_word_at_caret() if words[word] then -- cgit v1.2.3 From 2cab9ec9e0746f2ff3c41207e101c79db6d58ab2 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sat, 16 Apr 2022 14:52:36 -0400 Subject: Updated spellcheck to work with linewrapping. --- plugins/spellcheck.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 566bd3e..45f0e76 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -64,7 +64,7 @@ end local draw_line_text = DocView.draw_line_text function DocView:draw_line_text(idx, x, y) - draw_line_text(self, idx, x, y) + local lh = draw_line_text(self, idx, x, y) if not config.plugins.spellcheck.enable @@ -73,7 +73,7 @@ function DocView:draw_line_text(idx, x, y) or not matches_any(self.doc.filename or "", config.plugins.spellcheck.files) then - return + return lh end local s, e = 0, 0 @@ -85,12 +85,13 @@ function DocView:draw_line_text(idx, x, y) local word = text:sub(s, e):lower() if not words[word] and not active_word(self.doc, idx, e + 1) then local color = style.spellcheck_error or style.syntax.keyword2 - local x1 = x + self:get_col_x_offset(idx, s) - local x2 = x + self:get_col_x_offset(idx, e + 1) + local x1, y1 = self:get_line_screen_position(idx, s) + local x2, y2 = self:get_line_screen_position(idx, e + 1) local h = math.ceil(1 * SCALE) - renderer.draw_rect(x1, y + self:get_line_height() - h, x2 - x1, h, color) + renderer.draw_rect(x1, y1 + self:get_line_height() - h, x2 - x1, h, color) end end + return lh end -- cgit v1.2.3 From 35e947d1933613bb0b5a1488bf0fa4587f98ef7d Mon Sep 17 00:00:00 2001 From: jgmdev Date: Tue, 24 May 2022 19:29:50 -0400 Subject: added config_spec and other plugin compatibility fixes. --- plugins/autosave.lua | 20 ++++++- plugins/autowrap.lua | 20 ++++++- plugins/bigclock.lua | 30 +++++++++- plugins/centerdoc.lua | 75 +++++++++++++++++------ plugins/datetimestamps.lua | 27 ++++++++- plugins/gitstatus.lua | 47 ++++++++++----- plugins/indent_convert.lua | 14 ++++- plugins/linenumbers.lua | 26 ++++++-- plugins/memoryusage.lua | 26 ++++++++ plugins/minimap.lua | 140 ++++++++++++++++++++++++++++++++++++++----- plugins/motiontrail.lua | 30 +++++++++- plugins/nonicons.lua | 90 +++++++++++++++++++--------- plugins/openfilelocation.lua | 33 ++++++---- plugins/openselected.lua | 33 ++++++---- plugins/rainbowparen.lua | 42 +++++++++---- plugins/scalestatus.lua | 28 +++++++-- plugins/smallclock.lua | 44 +++++++++++++- plugins/smoothcaret.lua | 34 ++++++++++- plugins/spellcheck.lua | 82 ++++++++++++++++++------- plugins/statusclock.lua | 37 +++++++++++- plugins/tabnumbers.lua | 56 ++++++++++------- plugins/titleize.lua | 1 - plugins/typingspeed.lua | 135 +++++++++++++++++++++-------------------- 23 files changed, 834 insertions(+), 236 deletions(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/autosave.lua b/plugins/autosave.lua index 34d2ad6..7691e5a 100644 --- a/plugins/autosave.lua +++ b/plugins/autosave.lua @@ -9,8 +9,24 @@ local last_keypress = os.time() -- this exists so that we don't end up with multiple copies of the loop running at once local looping = false local on_text_change = Doc.on_text_change --- the approximate amount of time, in seconds, that it takes to trigger an autosave -config.plugins.autosave = common.merge({ timeout = 1 }, config.plugins.autosave) + +config.plugins.autosave = common.merge({ + -- the approximate amount of time, in seconds, that it takes to trigger an autosave + timeout = 1, + -- The config specification used by the settings gui + config_spec = { + name = "Auto Save", + { + label = "Timeout", + description = "Approximate amount of time in seconds it takes to trigger an autosave.", + path = "timeout", + type = "number", + default = 1, + min = 1, + max = 30 + } + } +}, config.plugins.autosave) local function loop_for_save() diff --git a/plugins/autowrap.lua b/plugins/autowrap.lua index fee001b..238053d 100644 --- a/plugins/autowrap.lua +++ b/plugins/autowrap.lua @@ -7,7 +7,25 @@ local DocView = require "core.docview" config.plugins.autowrap = common.merge({ enable = false, - files = { "%.md$", "%.txt$" } + files = { "%.md$", "%.txt$" }, + -- The config specification used by the settings gui + config_spec = { + name = "Auto Wrap", + { + label = "Enable", + description = "Activates text auto wrapping by default.", + path = "enable", + type = "toggle", + default = false + }, + { + label = "Files", + description = "List of Lua patterns matching files to auto wrap.", + path = "files", + type = "list_strings", + default = { "%.md$", "%.txt$" }, + } + } }, config.plugins.autowrap) diff --git a/plugins/bigclock.lua b/plugins/bigclock.lua index 1f38b02..66b63f1 100644 --- a/plugins/bigclock.lua +++ b/plugins/bigclock.lua @@ -10,7 +10,35 @@ local View = require "core.view" config.plugins.bigclock = common.merge({ time_format = "%H:%M:%S", date_format = "%A, %d %B %Y", - scale = 1 + scale = 1, + -- The config specification used by the settings gui + config_spec = { + name = "Big Clock", + { + label = "Time Format", + description = "Time specification defined with Lua date/time place holders.", + path = "time_format", + type = "string", + default = "%H:%M:%S" + }, + { + label = "Date Format", + description = "Date specification defined with Lua date/time place holders.", + path = "date_format", + type = "string", + default = "%A, %d %B %Y", + }, + { + label = "Scale", + description = "Size of the clock relative to screen.", + path = "scale", + type = "number", + default = 1, + min = 0.5, + max = 3.0, + step = 0.1 + } + } }, config.plugins.bigclock) diff --git a/plugins/centerdoc.lua b/plugins/centerdoc.lua index a771925..fb5943c 100644 --- a/plugins/centerdoc.lua +++ b/plugins/centerdoc.lua @@ -8,7 +8,8 @@ local treeview = require "plugins.treeview" local DocView = require "core.docview" config.plugins.centerdoc = common.merge({ - enable = true + enable = true, + zen_mode = false }, config.plugins.centerdoc) local draw_line_gutter = DocView.draw_line_gutter @@ -38,33 +39,69 @@ function DocView:get_gutter_width() end end -local zen_mode = false + local previous_win_status = system.get_window_mode() local previous_treeview_status = treeview.visible local previous_statusbar_status = core.status_view.visible +local function toggle_zen_mode(enabled) + config.plugins.centerdoc.zen_mode = enabled + + if config.plugins.centerdoc.zen_mode then + previous_win_status = system.get_window_mode() + previous_treeview_status = treeview.visible + previous_statusbar_status = core.status_view.visible + + config.plugins.centerdoc.enable = true + system.set_window_mode("fullscreen") + treeview.visible = false + command.perform "status-bar:hide" + else + config.plugins.centerdoc.enable = false + system.set_window_mode(previous_win_status) + treeview.visible = previous_treeview_status + core.status_view.visible = previous_statusbar_status + end +end + +local on_startup = true + +-- The config specification used by the settings gui +config.plugins.centerdoc.config_spec = { + name = "Center Document", + { + label = "Enable", + description = "Activates document centering by default.", + path = "enable", + type = "toggle", + default = true + }, + { + label = "Zen Mode", + description = "Activates zen mode by default.", + path = "zen_mode", + type = "toggle", + default = false, + on_apply = function(enabled) + if on_startup then + core.add_thread(function() + toggle_zen_mode(enabled) + end) + on_startup = false + else + toggle_zen_mode(enabled) + end + end + } +} + + command.add(nil, { ["center-doc:toggle"] = function() config.plugins.centerdoc.enable = not config.plugins.centerdoc.enable end, ["center-doc:zen-mode-toggle"] = function() - zen_mode = not zen_mode - - if zen_mode then - previous_win_status = system.get_window_mode() - previous_treeview_status = treeview.visible - previous_statusbar_status = core.status_view.visible - - config.plugins.centerdoc.enable = true - system.set_window_mode("fullscreen") - treeview.visible = false - command.perform "status-bar:hide" - else - config.plugins.centerdoc.enable = false - system.set_window_mode(previous_win_status) - treeview.visible = previous_treeview_status - core.status_view.visible = previous_statusbar_status - end + toggle_zen_mode(not config.plugins.centerdoc.zen_mode) end, }) diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index 2880f99..2cbc410 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -29,7 +29,32 @@ from https://www.lua.org/pil/22.1.html config.plugins.datetimestamps = common.merge({ format_datestamp = "%Y%m%d", format_datetimestamp = "%Y%m%d_%H%M%S", - format_timestamp = "%H%M%S" + format_timestamp = "%H%M%S", + -- The config specification used by the settings gui + config_spec = { + name = "Date and Time Stamps", + { + label = "Date", + description = "Date specification defined with Lua date/time place holders.", + path = "format_datestamp", + type = "string", + default = "%Y%m%d" + }, + { + label = "Time", + description = "Time specification defined with Lua date/time place holders.", + path = "format_timestamp", + type = "string", + default = "%H%M%S" + }, + { + label = "Date and Time", + description = "Date and time specification defined with Lua date/time place holders.", + path = "format_datetimestamp", + type = "string", + default = "%Y%m%d_%H%M%S" + } + } }, config.plugins.datetimestamps) local function datestamp() diff --git a/plugins/gitstatus.lua b/plugins/gitstatus.lua index 33dc5e5..9ba792c 100644 --- a/plugins/gitstatus.lua +++ b/plugins/gitstatus.lua @@ -6,15 +6,37 @@ local style = require "core.style" local StatusView = require "core.statusview" local TreeView = require "plugins.treeview" +config.plugins.gitstatus = common.merge({ + recurse_submodules = true, + -- The config specification used by the settings gui + config_spec = { + name = "Git Status", + { + label = "Recurse Submodules", + description = "Also retrieve git stats from submodules.", + path = "recurse_submodules", + type = "toggle", + default = true + } + } +}, config.plugins.gitstatus) + +style.gitstatus_addition = {common.color "#587c0c"} +style.gitstatus_modification = {common.color "#0c7d9d"} +style.gitstatus_deletion = {common.color "#94151b"} + local scan_rate = config.project_scan_rate or 5 local cached_color_for_item = {} --- Override TreeView's color_for_item, but first --- stash the old one (using [] in case it is not there at all) -local old_color_for_item = TreeView["color_for_item"] -function TreeView:color_for_item(abs_path) - return cached_color_for_item[abs_path] or old_color_for_item(abs_path) +-- Override TreeView's get_item_text to add modification color +local treeview_get_item_text = TreeView.get_item_text +function TreeView:get_item_text(item, active, hovered) + local text, font, color = treeview_get_item_text(self, item, active, hovered) + if cached_color_for_item[item.abs_filename] then + color = cached_color_for_item[item.abs_filename] + end + return text, font, color end @@ -24,15 +46,6 @@ local git = { deletes = 0, } - -config.gitstatus = { - recurse_submodules = true -} -style.gitstatus_addition = {common.color "#587c0c"} -style.gitstatus_modification = {common.color "#0c7d9d"} -style.gitstatus_deletion = {common.color "#94151b"} - - local function exec(cmd) local proc = process.start(cmd) -- Don't use proc:wait() here - that will freeze the app. @@ -57,7 +70,11 @@ core.add_thread(function() -- get diff local diff = exec({"git", "diff", "--numstat"}) - if config.gitstatus.recurse_submodules and system.get_file_info(".gitmodules") then + if + config.plugins.gitstatus.recurse_submodules + and + system.get_file_info(".gitmodules") + then local diff2 = exec({"git", "submodule", "foreach", "git diff --numstat"}) diff = diff .. diff2 end diff --git a/plugins/indent_convert.lua b/plugins/indent_convert.lua index 2442b39..af241a7 100644 --- a/plugins/indent_convert.lua +++ b/plugins/indent_convert.lua @@ -5,7 +5,19 @@ local config = require "core.config" local command = require "core.command" config.plugins.indent_convert = common.merge({ - update_indent_type = true -- set to false to avoid updating the document indent type + -- set to false to avoid updating the document indent type + update_indent_type = true, + -- The config specification used by the settings gui + config_spec = { + name = "Indent Convert", + { + label = "Update Indent Type", + description = "Disable to avoid updating the document indent type.", + path = "update_indent_type", + type = "toggle", + default = true + } + } }, config.plugins.indent_convert) local zero_pattern = _VERSION == "Lua 5.1" and "%z" or "\0" diff --git a/plugins/linenumbers.lua b/plugins/linenumbers.lua index 76c691d..5cf198a 100644 --- a/plugins/linenumbers.lua +++ b/plugins/linenumbers.lua @@ -7,7 +7,25 @@ local command = require "core.command" config.plugins.linenumbers = common.merge({ show = true, - relative = false + relative = false, + -- The config specification used by the settings gui + config_spec = { + name = "Line Numbers", + { + label = "Show Numbers", + description = "Display or hide the line numbers.", + path = "show", + type = "toggle", + default = true + }, + { + label = "Relative Line Numbers", + description = "Display relative line numbers starting from active line.", + path = "relative", + type = "toggle", + default = false + } + } }, config.plugins.linenumbers) local draw_line_gutter = DocView.draw_line_gutter @@ -15,11 +33,7 @@ local get_width = DocView.get_gutter_width function DocView:draw_line_gutter(line, x, y, width) local lh = self:get_line_height() - if - not config.plugins.linenumbers.show - and - not config.plugins.linenumbers.relative - then + if not config.plugins.linenumbers.show then return lh end diff --git a/plugins/memoryusage.lua b/plugins/memoryusage.lua index e06b883..a8b8005 100644 --- a/plugins/memoryusage.lua +++ b/plugins/memoryusage.lua @@ -1,9 +1,35 @@ -- mod-version:3 --lite-xl 2.1 -- original implementation by AqilCont local core = require "core" +local config = require "core.config" +local common = require "core.common" local style = require "core.style" local StatusView = require "core.statusview" +config.plugins.memoryusage = common.merge({ + enabled = true, + -- The config specification used by the settings gui + config_spec = { + name = "Memory Usage", + { + label = "Enabled", + description = "Show or hide the lua memory usage from the status bar.", + path = "enabled", + type = "toggle", + default = true, + on_apply = function(enabled) + core.add_thread(function() + if enabled then + core.status_view:get_item("status:memory-usage"):show() + else + core.status_view:get_item("status:memory-usage"):hide() + end + end) + end + } + } +}, config.plugins.memoryusage) + core.status_view:add_item( nil, "status:memory-usage", diff --git a/plugins/minimap.lua b/plugins/minimap.lua index ac86b85..932f9dd 100644 --- a/plugins/minimap.lua +++ b/plugins/minimap.lua @@ -7,6 +7,19 @@ local style = require "core.style" local DocView = require "core.docview" local Object = require "core.object" +-- Sample configurations: +-- full width: +-- config.plugins.minimap.highlight_width = 100 +-- config.plugins.minimap.gutter_width = 0 +-- left side: +-- config.plugins.minimap.highlight_align = 'left' +-- config.plugins.minimap.highlight_width = 3 +-- config.plugins.minimap.gutter_width = 4 +-- right side: +-- config.plugins.minimap.highlight_align = 'right' +-- config.plugins.minimap.highlight_width = 5 +-- config.plugins.minimap.gutter_width = 0 + -- General plugin settings config.plugins.minimap = common.merge({ enabled = true, @@ -17,28 +30,127 @@ config.plugins.minimap = common.merge({ -- how many spaces one tab is equivalent to tab_width = 4, draw_background = true, - -- you can override these colors selection_color = nil, caret_color = nil, - -- If other plugins provide per-line highlights, -- this controls the placement. (e.g. gitdiff_highlight) highlight_align = 'left', highlight_width = 3, gutter_width = 5, - -- try these values: - -- full width: - -- config.plugins.minimap.highlight_width = 100 - -- config.plugins.minimap.gutter_width = 0 - -- left side: - -- config.plugins.minimap.highlight_align = 'left' - -- config.plugins.minimap.highlight_width = 3 - -- config.plugins.minimap.gutter_width = 4 - -- right side: - -- config.plugins.minimap.highlight_align = 'right' - -- config.plugins.minimap.highlight_width = 5 - -- config.plugins.minimap.gutter_width = 0 + -- The config specification used by the settings gui + config_spec = { + name = "Mini Map", + { + label = "Enabled", + description = "Activate the minimap by default.", + path = "enabled", + type = "toggle", + default = true + }, + { + label = "Width", + description = "Width of the minimap in pixels.", + path = "width", + type = "number", + default = 100, + min = 50, + max = 1000 + }, + { + label = "Instant Scroll", + description = "When enabled disables the scrolling animation.", + path = "instant_scroll", + type = "toggle", + default = false + }, + { + label = "Syntax Highlighting", + description = "Disable to improve performance.", + path = "syntax_highlight", + type = "toggle", + default = true + }, + { + label = "Scale", + description = "Size of the minimap using a scaling factor.", + path = "scale", + type = "number", + default = 1, + min = 0.5, + max = 10, + step = 0.1 + }, + { + label = "Tabs Width", + description = "The amount of spaces that represent a tab.", + path = "tab_width", + type = "number", + default = 4, + min = 1, + max = 8 + }, + { + label = "Draw Background", + description = "When disabled makes the minimap transparent.", + path = "draw_background", + type = "toggle", + default = true + }, + { + label = "Selection Color", + description = "Background color of selected text in html notation eg: #FFFFFF. Leave empty to use default.", + path = "selection_color_html", + type = "string", + on_apply = function(value) + if value and value:match("#%x%x%x%x%x%x") then + config.plugins.minimap.selection_color = { common.color(value) } + else + config.plugins.minimap.selection_color = nil + end + end + }, + { + label = "Caret Color", + description = "Background color of active line in html notation eg: #FFFFFF. Leave empty to use default.", + path = "caret_color_html", + type = "string", + on_apply = function(value) + if value and value:match("#%x%x%x%x%x%x") then + config.plugins.minimap.caret_color = { common.color(value) } + else + config.plugins.minimap.caret_color = nil + end + end + }, + { + label = "Highlight Alignment", + path = "highlight_align", + type = "selection", + default = "left", + values = { + {"Left", "left"}, + {"Right", "right"} + } + }, + { + label = "Highlight Width", + path = "highlight_width", + type = "number", + default = 3, + min = 0, + max = 50 + }, + { + label = "Gutter Width", + description = "Left padding of the minimap.", + path = "gutter_width", + type = "number", + default = 5, + min = 0, + max = 50 + }, + } }, config.plugins.minimap) -- Configure size for rendering each char in the minimap diff --git a/plugins/motiontrail.lua b/plugins/motiontrail.lua index fd42b5f..cc94ca9 100644 --- a/plugins/motiontrail.lua +++ b/plugins/motiontrail.lua @@ -5,7 +5,30 @@ local common = require "core.common" local style = require "core.style" local DocView = require "core.docview" -config.plugins.motiontrail = common.merge({ steps = 50 }, config.plugins.motiontrail) +config.plugins.motiontrail = common.merge({ + enabled = true, + steps = 50, + -- The config specification used by the settings gui + config_spec = { + name = "Motion Trail", + { + label = "Enabled", + description = "Disable or enable the caret motion trail effect.", + path = "enabled", + type = "toggle", + default = true + }, + { + label = "Steps", + description = "Amount of trail steps to generate on caret movement.", + path = "steps", + type = "number", + default = 50, + min = 10, + max = 100 + }, + } +}, config.plugins.motiontrail) local function lerp(a, b, t) @@ -16,7 +39,6 @@ end local function get_caret_rect(dv) local line, col = dv.doc:get_selection() local x, y = dv:get_line_screen_position(line, col) - x = x + dv:get_col_x_offset(line, col) return x, y, style.caret_width, dv:get_line_height() end @@ -27,7 +49,9 @@ local draw = DocView.draw function DocView:draw(...) draw(self, ...) - if self ~= core.active_view then return end + if not config.plugins.motiontrail.enabled or self ~= core.active_view then + return + end local x, y, w, h = get_caret_rect(self) diff --git a/plugins/nonicons.lua b/plugins/nonicons.lua index baded52..e249508 100644 --- a/plugins/nonicons.lua +++ b/plugins/nonicons.lua @@ -13,7 +13,40 @@ local Node = require "core.node" config.plugins.nonicons = common.merge({ use_default_dir_icons = false, use_default_chevrons = false, - draw_tab_icons = true + draw_treeview_icons = true, + draw_tab_icons = true, + -- The config specification used by the settings gui + config_spec = { + name = "Nonicons", + { + label = "Use Default Directory Icons", + description = "When enabled does not use nonicon directory icons.", + path = "use_default_dir_icons", + type = "toggle", + default = false + }, + { + label = "Use Default Chevrons", + description = "When enabled does not use nonicon expand/collapse arrow icons.", + path = "use_default_chevrons", + type = "toggle", + default = false + }, + { + label = "Draw Treeview Icons", + description = "Enables file related icons on the treeview.", + path = "draw_treeview_icons", + type = "toggle", + default = true + }, + { + label = "Draw Tab Icons", + description = "Adds file related icons to tabs.", + path = "draw_tab_icons", + type = "toggle", + default = true + } + } }, config.plugins.nonicons) local icon_font = renderer.font.load(USERDIR.."/fonts/nonicons.ttf", 15 * SCALE) @@ -79,39 +112,39 @@ for k, v in pairs(known_names_icons) do v[1] = { common.color(v[1]) } end --- Override function to define dir and file custom icons if setting is disabled -if not config.plugins.nonicons.use_default_dir_icons then - function TreeView:get_item_icon(item, active, hovered) - local icon = "" -- unicode 61766 - if item.type == "dir" then - icon = item.expanded and "" or "" -- unicode 61771 and 61772 - end - return icon, icon_font, style.text - end -end - --- Override function to change default icons for special extensions and names +-- Override function to change default icons for dirs, special extensions and names local TreeView_get_item_icon = TreeView.get_item_icon function TreeView:get_item_icon(item, active, hovered) local icon, font, color = TreeView_get_item_icon(self, item, active, hovered) - local custom_icon = known_names_icons[item.name:lower()] - if custom_icon == nil then - custom_icon = extension_icons[item.name:match("^.+(%..+)$")] - end - if custom_icon ~= nil then - color = custom_icon[1] - icon = custom_icon[2] + if not config.plugins.nonicons.use_default_dir_icons then + icon = "" -- unicode 61766 font = icon_font + color = style.text + if item.type == "dir" then + icon = item.expanded and "" or "" -- unicode 61771 and 61772 + end end - if active or hovered then - color = style.accent + if config.plugins.nonicons.draw_treeview_icons then + local custom_icon = known_names_icons[item.name:lower()] + if custom_icon == nil then + custom_icon = extension_icons[item.name:match("^.+(%..+)$")] + end + if custom_icon ~= nil then + color = custom_icon[1] + icon = custom_icon[2] + font = icon_font + end + if active or hovered then + color = style.accent + end end return icon, font, color end -- Override function to draw chevrons if setting is disabled -if not config.plugins.nonicons.use_default_chevrons then - function TreeView:draw_item_chevron(item, active, hovered, x, y, w, h) +local TreeView_draw_item_chevron = TreeView.draw_item_chevron +function TreeView:draw_item_chevron(item, active, hovered, x, y, w, h) + if not config.plugins.nonicons.use_default_chevrons then if item.type == "dir" then local chevron_icon = item.expanded and "" or "" local chevron_color = hovered and style.accent or style.text @@ -119,12 +152,13 @@ if not config.plugins.nonicons.use_default_chevrons then end return chevron_width + style.padding.x/4 end + return TreeView_draw_item_chevron(self, item, active, hovered, x, y, w, h) end -- Override function to draw icons in tabs titles if setting is enabled -if config.plugins.nonicons.draw_tab_icons then - local Node_draw_tab_title = Node.draw_tab_title - function Node:draw_tab_title(view, font, is_active, is_hovered, x, y, w, h) +local Node_draw_tab_title = Node.draw_tab_title +function Node:draw_tab_title(view, font, is_active, is_hovered, x, y, w, h) + if config.plugins.nonicons.draw_tab_icons then local padx = chevron_width + style.padding.x/2 local tx = x + padx -- Space for icon w = w - padx @@ -132,5 +166,7 @@ if config.plugins.nonicons.draw_tab_icons then if (view == nil) or (view.doc == nil) then return end local item = { type = "file", name = view.doc:get_name() } TreeView:draw_item_icon(item, false, is_hovered, x, y, w, h) + else + Node_draw_tab_title(self, view, font, is_active, is_hovered, x, y, w, h) end end diff --git a/plugins/openfilelocation.lua b/plugins/openfilelocation.lua index 0328142..8e225cd 100644 --- a/plugins/openfilelocation.lua +++ b/plugins/openfilelocation.lua @@ -1,20 +1,33 @@ -- mod-version:3 --lite-xl 2.1 local core = require "core" +local common = require "core.common" local command = require "core.command" local config = require "core.config" - -config.plugins.openfilelocation = {} -if not config.plugins.openfilelocation.filemanager then - if PLATFORM == "Windows" then - config.plugins.openfilelocation.filemanager = "explorer" - elseif PLATFORM == "Mac OS X" then - config.plugins.openfilelocation.filemanager = "open" - else - config.plugins.openfilelocation.filemanager = "xdg-open" - end +local platform_filemanager +if PLATFORM == "Windows" then + platform_filemanager = "explorer" +elseif PLATFORM == "Mac OS X" then + platform_filemanager = "open" +else + platform_filemanager = "xdg-open" end +config.plugins.openfilelocation = common.merge({ + filemanager = platform_filemanager, + -- The config specification used by the settings gui + config_spec = { + name = "Open File Location", + { + label = "File Manager", + description = "Command of the file browser.", + path = "filemanager", + type = "string", + default = platform_filemanager + } + } +}, config.plugins.openfilelocation) + command.add("core.docview", { ["open-file-location:open-file-location"] = function() local doc = core.active_view.doc diff --git a/plugins/openselected.lua b/plugins/openselected.lua index c2cb3a4..7df4dba 100644 --- a/plugins/openselected.lua +++ b/plugins/openselected.lua @@ -7,17 +7,30 @@ local config = require "core.config" local contextmenu = require "plugins.contextmenu" -config.plugins.openselected = {} -if not config.plugins.openselected.filemanager then - if PLATFORM == "Windows" then - config.plugins.openselected.filemanager = "start" - elseif PLATFORM == "Mac OS X" then - config.plugins.openselected.filemanager = "open" - else - config.plugins.openselected.filemanager = "xdg-open" - end +local platform_filelauncher +if PLATFORM == "Windows" then + platform_filelauncher = "start" +elseif PLATFORM == "Mac OS X" then + platform_filelauncher = "open" +else + platform_filelauncher = "xdg-open" end +config.plugins.openselected = common.merge({ + filelauncher = platform_filelauncher, + -- The config specification used by the settings gui + config_spec = { + name = "Open Selected Text", + { + label = "File Launcher", + description = "Command used to open the selected path or link externally.", + path = "filelauncher", + type = "string", + default = platform_filelauncher + } + } +}, config.plugins.openselected) + command.add("core.docview", { ["open-selected:open-selected"] = function() local doc = core.active_view.doc @@ -38,7 +51,7 @@ command.add("core.docview", { core.log("Opening %s...", text) - system.exec(config.plugins.openselected.filemanager .. " " .. text) + system.exec(config.plugins.openselected.filelauncher .. " " .. text) end, }) diff --git a/plugins/rainbowparen.lua b/plugins/rainbowparen.lua index 0f63473..1df56ed 100644 --- a/plugins/rainbowparen.lua +++ b/plugins/rainbowparen.lua @@ -11,15 +11,24 @@ config.plugins.rainbowparen = common.merge({ enable = true }, config.plugins.rainbowparen) +style.syntax.paren_unbalanced = style.syntax.paren_unbalanced or { common.color "#DC0408" } +style.syntax.paren1 = style.syntax.paren1 or { common.color "#FC6F71"} +style.syntax.paren2 = style.syntax.paren2 or { common.color "#fcb053"} +style.syntax.paren3 = style.syntax.paren3 or { common.color "#fcd476"} +style.syntax.paren4 = style.syntax.paren4 or { common.color "#52dab2"} +style.syntax.paren5 = style.syntax.paren5 or { common.color "#5a98cf"} + local tokenize = tokenizer.tokenize local closers = { ["("] = ")", ["["] = "]", ["{"] = "}" } + local function parenstyle(parenstack) return "paren" .. ((#parenstack % 5) + 1) end + function tokenizer.tokenize(syntax, text, state) if not config.plugins.rainbowparen.enable then return tokenize(syntax, text, state) @@ -62,20 +71,31 @@ function tokenizer.tokenize(syntax, text, state) return newres, { parenstack = parenstack, istate = istate } end -style.syntax.paren_unbalanced = style.syntax.paren_unbalanced or { common.color "#DC0408" } -style.syntax.paren1 = style.syntax.paren1 or { common.color "#FC6F71"} -style.syntax.paren2 = style.syntax.paren2 or { common.color "#fcb053"} -style.syntax.paren3 = style.syntax.paren3 or { common.color "#fcd476"} -style.syntax.paren4 = style.syntax.paren4 or { common.color "#52dab2"} -style.syntax.paren5 = style.syntax.paren5 or { common.color "#5a98cf"} +local function toggle_rainbowparen(enabled) + config.plugins.rainbowparen.enable = enabled + for _, doc in ipairs(core.docs) do + doc.highlighter = Highlighter(doc) + doc:reset_syntax() + end +end +-- The config specification used by the settings gui +config.plugins.rainbowparen.config_spec = { + name = "Rainbow Parentheses", + { + label = "Enable", + description = "Activates rainbow parenthesis coloring by default.", + path = "enable", + type = "toggle", + default = true, + on_apply = function(enabled) + toggle_rainbowparen(enabled) + end + } +} command.add(nil, { ["rainbow-parentheses:toggle"] = function() - config.plugins.rainbowparen.enable = not config.plugins.rainbowparen.enable - for _, doc in ipairs(core.docs) do - doc.highlighter = Highlighter(doc) - doc:reset_syntax() - end + toggle_rainbowparen(not config.plugins.rainbowparen.enable) end }) diff --git a/plugins/scalestatus.lua b/plugins/scalestatus.lua index 85774a8..2379ed4 100644 --- a/plugins/scalestatus.lua +++ b/plugins/scalestatus.lua @@ -11,10 +11,30 @@ local config = require "core.config" local scale = require "plugins.scale" local StatusView = require "core.statusview" -config.plugins.scalestatus = common.merge( - { format = '%.0f%%' }, - config.plugins.scalestatus -) +config.plugins.scalestatus = common.merge({ + enabled = true, + format = '%.0f%%', + -- The config specification used by the settings gui + config_spec = { + name = "Scale Status", + { + label = "Enabled", + description = "Show or hide the scale status from the status bar.", + path = "enabled", + type = "toggle", + default = true, + on_apply = function(enabled) + core.add_thread(function() + if enabled then + core.status_view:get_item("status:scale"):show() + else + core.status_view:get_item("status:scale"):hide() + end + end) + end + } + } +}, config.plugins.scalestatus) core.status_view:add_item( nil, diff --git a/plugins/smallclock.lua b/plugins/smallclock.lua index 201a65a..7bc756c 100644 --- a/plugins/smallclock.lua +++ b/plugins/smallclock.lua @@ -1,15 +1,55 @@ -- mod-version:3 --lite-xl 2.1 local core = require "core" +local config = require "core.config" +local common = require "core.common" local style = require "core.style" local StatusView = require "core.statusview" +config.plugins.smallclock = common.merge({ + enabled = true, + clock_type = "24", + -- The config specification used by the settings gui + config_spec = { + name = "Small Clock", + { + label = "Enabled", + description = "Show or hide the small clock from the status bar.", + path = "enabled", + type = "toggle", + default = true, + on_apply = function(enabled) + core.add_thread(function() + if enabled then + core.status_view:get_item("status:small-clock"):show() + else + core.status_view:get_item("status:small-clock"):hide() + end + end) + end + }, + { + label = "Clock Type", + description = "Choose between 12 or 24 hours clock mode.", + path = "clock_type", + type = "selection", + default = "24", + values = { + {"24 Hours", "24"}, + {"12 Hours", "12"} + } + } + } +}, config.plugins.smallclock) + local time = "" local last_time = os.time() local function update_time() if os.time() > last_time then - local t = os.date("*t") - time = string.format("%02d:%02d", t.hour, t.min) + local h = config.plugins.smallclock.clock_type == "24" + and os.date("%H") or os.date("%I") + local m = os.date("%M") + time = string.format("%02d:%02d", h, m) last_time = os.time() end end diff --git a/plugins/smoothcaret.lua b/plugins/smoothcaret.lua index 75ee769..3a30d5b 100644 --- a/plugins/smoothcaret.lua +++ b/plugins/smoothcaret.lua @@ -5,12 +5,38 @@ local style = require "core.style" local common = require "core.common" local DocView = require "core.docview" -config.plugins.smoothcaret = common.merge({ rate = 0.65 }, config.plugins.smoothcaret) +config.plugins.smoothcaret = common.merge({ + enabled = true, + rate = 0.65, + -- The config specification used by the settings gui + config_spec = { + name = "Smooth Caret", + { + label = "Enabled", + description = "Disable or enable the smooth caret animation.", + path = "enabled", + type = "toggle", + default = true + }, + { + label = "Rate", + description = "Speed of the animation.", + path = "rate", + type = "number", + default = 0.65, + min = 0.2, + max = 1.0, + step = 0.05 + }, + } +}, config.plugins.smoothcaret) local docview_update = DocView.update function DocView:update() docview_update(self) + if not config.plugins.smoothcaret.enabled then return end + local minline, maxline = self:get_visible_line_range() -- We need to keep track of all the carets @@ -73,7 +99,13 @@ function DocView:update() self.caret_idx = 1 end +local docview_draw_caret = DocView.draw_caret function DocView:draw_caret(x, y) + if not config.plugins.smoothcaret.enabled then + docview_draw_caret(self, x, y) + return + end + local c = self.visible_carets[self.caret_idx] or { current = { x = x, y = y } } local lh = self:get_line_height() diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 45f0e76..0f79cab 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -7,35 +7,42 @@ local common = require "core.common" local DocView = require "core.docview" local Doc = require "core.doc" +local platform_dictionary_file +if PLATFORM == "Windows" then + platform_dictionary_file = EXEDIR .. "/words.txt" +else + platform_dictionary_file = "/usr/share/dict/words" +end + config.plugins.spellcheck = common.merge({ - enable = true, + enabled = true, files = { "%.txt$", "%.md$", "%.markdown$" }, - dictionary_file = PLATFORM == "Windows" - and EXEDIR .. "/words.txt" - or "/usr/share/dict/words" + dictionary_file = platform_dictionary_file }, config.plugins.spellcheck) local last_input_time = 0 local word_pattern = "%a+" local words -core.add_thread(function() - local t = {} - local i = 0 - for line in io.lines(config.plugins.spellcheck.dictionary_file) do - for word in line:gmatch(word_pattern) do - t[word:lower()] = true +local function load_dictionary() + core.add_thread(function() + local t = {} + local i = 0 + for line in io.lines(config.plugins.spellcheck.dictionary_file) do + for word in line:gmatch(word_pattern) do + t[word:lower()] = true + end + i = i + 1 + if i % 1000 == 0 then coroutine.yield() end end - i = i + 1 - if i % 1000 == 0 then coroutine.yield() end - end - words = t - core.redraw = true - core.log_quiet( - "Finished loading dictionary file: \"%s\"", - config.plugins.spellcheck.dictionary_file - ) -end) + words = t + core.redraw = true + core.log_quiet( + "Finished loading dictionary file: \"%s\"", + config.plugins.spellcheck.dictionary_file + ) + end) +end local function matches_any(filename, ptns) @@ -67,7 +74,7 @@ function DocView:draw_line_text(idx, x, y) local lh = draw_line_text(self, idx, x, y) if - not config.plugins.spellcheck.enable + not config.plugins.spellcheck.enabled or not words or @@ -120,10 +127,41 @@ local function compare_words(word1, word2) end +-- The config specification used by the settings gui +config.plugins.spellcheck.config_spec = { + name = "Spell Check", + { + label = "Enabled", + description = "Disable or enable spell checking.", + path = "enabled", + type = "toggle", + default = true + }, + { + label = "Files", + description = "List of Lua patterns matching files to spell check.", + path = "files", + type = "list_strings", + default = { "%.txt$", "%.md$", "%.markdown$" } + }, + { + label = "Dictionary File", + description = "Path to a text file that contains a list of dictionary words.", + path = "dictionary_file", + type = "string", + default = platform_dictionary_file, + on_apply = function() + load_dictionary() + end + } +} + +load_dictionary() + command.add("core.docview", { ["spell-check:toggle"] = function() - config.plugins.spellcheck.enable = not config.plugins.spellcheck.enable + config.plugins.spellcheck.enabled = not config.plugins.spellcheck.enabled end, ["spell-check:add-to-dictionary"] = function() diff --git a/plugins/statusclock.lua b/plugins/statusclock.lua index d39ca63..6d37b37 100644 --- a/plugins/statusclock.lua +++ b/plugins/statusclock.lua @@ -6,8 +6,43 @@ local common = require "core.common" local StatusView = require "core.statusview" config.plugins.statusclock = common.merge({ + enabled = true, time_format = "%H:%M:%S", - date_format = "%A, %d %B %Y" + date_format = "%A, %d %B %Y", + -- The config specification used by the settings gui + config_spec = { + name = "Status Clock", + { + label = "Enabled", + description = "Show or hide the clock from the status bar.", + path = "enabled", + type = "toggle", + default = true, + on_apply = function(enabled) + core.add_thread(function() + if enabled then + core.status_view:get_item("status:clock"):show() + else + core.status_view:get_item("status:clock"):hide() + end + end) + end + }, + { + label = "Time Format", + description = "Time specification defined with Lua date/time place holders.", + path = "time_format", + type = "string", + default = "%H:%M:%S" + }, + { + label = "Date Format", + description = "Date specification defined with Lua date/time place holders.", + path = "date_format", + type = "string", + default = "%A, %d %B %Y", + } + } }, config.plugins.statusclock) local time_data = { diff --git a/plugins/tabnumbers.lua b/plugins/tabnumbers.lua index 1656100..3a842b7 100644 --- a/plugins/tabnumbers.lua +++ b/plugins/tabnumbers.lua @@ -1,28 +1,44 @@ -- mod-version:3 --lite-xl 2.1 +local config = require "core.config" local common = require "core.common" -local core = require "core" local style = require "core.style" +local Node = require "core.node" --- quite hackish, but Node isn't normally public -local Node = getmetatable(core.root_view.root_node) -local draw_tabs = Node.draw_tabs +config.plugins.tabnumbers = common.merge({ + enabled = true, + -- The config specification used by the settings gui + config_spec = { + name = "Tab Numbers", + { + label = "Draw Tab Numbers", + description = "Show or hide numbers on the interface tabs.", + path = "enabled", + type = "toggle", + default = true + } + } +}, config.plugins.tabnumbers) -function Node:draw_tabs(...) - draw_tabs(self, ...) - - for i, view in ipairs(self.views) do - if i > 9 then break end - - local x, y, w, h = self:get_tab_rect(i) - local number = tostring(i) - local color = style.dim - local title_width = style.font:get_width(view:get_name()) - local free_real_estate = - math.min(math.max((w - title_width) / 2, style.padding.x), h) - if view == self.active_view then - color = style.accent +-- Overwrite draw_tab_title to prepend tab number +local Node_draw_tab_title = Node.draw_tab_title +function Node:draw_tab_title(view, font, is_active, is_hovered, x, y, w, h) + if config.plugins.tabnumbers.enabled then + local number = "" + for i, v in ipairs(self.views) do + if view == v then + number = tostring(i) + end + end + local padx = 0 + if number ~= "" then + padx = style.font:get_width(number) + (style.padding.x / 2) + w = w - padx + local color = is_active and style.text or style.dim + common.draw_text(style.font, color, number, nil, x, y, w, h) end - -- renderer.draw_rect(x, y + h - 1, free_real_estate, 1, color) - common.draw_text(style.font, color, number, "center", x, y, free_real_estate, h) + local tx = x + padx -- Space for number + Node_draw_tab_title(self, view, font, is_active, is_hovered, tx, y, w, h) + else + Node_draw_tab_title(self, view, font, is_active, is_hovered, x, y, w, h) end end diff --git a/plugins/titleize.lua b/plugins/titleize.lua index 179e52b..b329671 100644 --- a/plugins/titleize.lua +++ b/plugins/titleize.lua @@ -9,4 +9,3 @@ command.add("core.docview", { end) end, }) - diff --git a/plugins/typingspeed.lua b/plugins/typingspeed.lua index 62e44ef..d639252 100644 --- a/plugins/typingspeed.lua +++ b/plugins/typingspeed.lua @@ -6,17 +6,38 @@ local common = require "core.common" local config = require "core.config" local DocView = require "core.docview" -if common["merge"] then - config.plugins.typingspeed = common.merge({ - -- characters that should be counted as word boundary - word_boundaries = "[%p%s]", - }, config.plugins.keystats) -else - config.plugins.typingspeed = { - -- characters that should be counted as word boundary - word_boundaries = "[%p%s]", - } -end +config.plugins.typingspeed = common.merge({ + enabled = true, + -- characters that should be counted as word boundary + word_boundaries = "[%p%s]", + -- The config specification used by the settings gui + config_spec = { + name = "Typing Speed", + { + label = "Enabled", + description = "Show or hide the typing speed from the status bar.", + path = "enabled", + type = "toggle", + default = true, + on_apply = function(enabled) + core.add_thread(function() + if enabled then + core.status_view:get_item("typing-speed:stats"):show() + else + core.status_view:get_item("typing-speed:stats"):hide() + end + end) + end + }, + { + label = "Word Boundaries", + description = "Lua pattern that matches characters to separate words.", + path = "word_boundaries", + type = "string", + default = "[%p%s]" + } + } +}, config.plugins.typingspeed) local chars = 0 local chars_last = 0 @@ -29,65 +50,51 @@ local wpm = 0 core.add_thread(function() while true do - local t = os.date("*t") - if t.sec <= time_last then - words_last = words - words = 0 - chars_last = chars - chars = 0 - time_last = t.sec - end - wpm = words_last * (1-(t.sec)/60) + words - cpm = chars_last * (1-(t.sec)/60) + chars + if config.plugins.typingspeed.enabled then + local t = os.date("*t") + if t.sec <= time_last then + words_last = words + words = 0 + chars_last = chars + chars = 0 + time_last = t.sec + end + wpm = words_last * (1-(t.sec)/60) + words + cpm = chars_last * (1-(t.sec)/60) + chars + end coroutine.yield(1) end end) local on_text_input = DocView.on_text_input function DocView:on_text_input(text, idx) - chars = chars + 1 - if string.find(text, config.plugins.typingspeed.word_boundaries) then - if started_word then - words = words + 1 - started_word = false - end - else - started_word = true - end + if config.plugins.typingspeed.enabled then + chars = chars + 1 + if string.find(text, config.plugins.typingspeed.word_boundaries) then + if started_word then + words = words + 1 + started_word = false + end + else + started_word = true + end + end on_text_input(self, text, idx) end -if core.status_view["add_item"] then - core.status_view:add_item( - function() - return core.active_view and getmetatable(core.active_view) == DocView - end, - "keystats:stats", - core.status_view.Item.RIGHT, - function() - return { - style.text, - string.format("%.0f CPM / %.0f WPM", cpm, wpm) - } - end, - nil, - 1, - "characters / words per minute" - ).separator = core.status_view.separator2 -else - local get_items = core.status_view.get_items - function core.status_view:get_items() - local left, right = get_items(self) - - local t = { - style.text, string.format("%.0f CPM / %.0f WPM", cpm, wpm), - style.dim, self.separator2 - } - - for i, item in ipairs(t) do - table.insert(right, i, item) - end - - return left, right - end -end +core.status_view:add_item( + function() + return core.active_view and getmetatable(core.active_view) == DocView + end, + "typing-speed:stats", + core.status_view.Item.RIGHT, + function() + return { + style.text, + string.format("%.0f CPM / %.0f WPM", cpm, wpm) + } + end, + nil, + 1, + "characters / words per minute" +).separator = core.status_view.separator2 -- cgit v1.2.3 From d30a72bdb1dd815461745122c5a3523d1824c381 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Tue, 31 May 2022 16:25:02 -0400 Subject: removed lite-xl version and left only mod version --- plugins/autoinsert.lua | 2 +- plugins/autosave.lua | 2 +- plugins/autosaveonfocuslost.lua | 2 +- plugins/autowrap.lua | 2 +- plugins/bigclock.lua | 2 +- plugins/bracketmatch.lua | 2 +- plugins/centerdoc.lua | 2 +- plugins/colorpreview.lua | 2 +- plugins/copyfilelocation.lua | 2 +- plugins/datetimestamps.lua | 2 +- plugins/dragdropselected.lua | 2 +- plugins/ephemeral_tabs.lua | 2 +- plugins/eval.lua | 2 +- plugins/exec.lua | 2 +- plugins/extend_selection_line.lua | 2 +- plugins/fontconfig.lua | 2 +- plugins/force_syntax.lua | 2 +- plugins/ghmarkdown.lua | 2 +- plugins/gitstatus.lua | 2 +- plugins/gofmt.lua | 2 +- plugins/indent_convert.lua | 2 +- plugins/indentguide.lua | 2 +- plugins/language_R.lua | 4 +- plugins/language_angelscript.lua | 2 +- plugins/language_batch.lua | 2 +- plugins/language_bib.lua | 2 +- plugins/language_cmake.lua | 2 +- plugins/language_cpp.lua | 2 +- plugins/language_crystal.lua | 2 +- plugins/language_csharp.lua | 2 +- plugins/language_d.lua | 2 +- plugins/language_dart.lua | 2 +- plugins/language_diff.lua | 2 +- plugins/language_elixir.lua | 2 +- plugins/language_elm.lua | 2 +- plugins/language_fe.lua | 2 +- plugins/language_fennel.lua | 2 +- plugins/language_fstab.lua | 6 +- plugins/language_gdscript.lua | 2 +- plugins/language_glsl.lua | 2 +- plugins/language_gmi.lua | 2 +- plugins/language_go.lua | 2 +- plugins/language_hlsl.lua | 2 +- plugins/language_hs.lua | 2 +- plugins/language_ini.lua | 2 +- plugins/language_java.lua | 2 +- plugins/language_jiyu.lua | 2 +- plugins/language_jsx.lua | 2 +- plugins/language_julia.lua | 2 +- plugins/language_liquid.lua | 28 +++++----- plugins/language_lobster.lua | 6 +- plugins/language_make.lua | 2 +- plugins/language_meson.lua | 2 +- plugins/language_moon.lua | 2 +- plugins/language_nginx.lua | 2 +- plugins/language_nim.lua | 2 +- plugins/language_objc.lua | 2 +- plugins/language_odin.lua | 2 +- plugins/language_perl.lua | 2 +- plugins/language_php.lua | 2 +- plugins/language_pico8.lua | 2 +- plugins/language_pkgbuild.lua | 2 +- plugins/language_po.lua | 2 +- plugins/language_powershell.lua | 2 +- plugins/language_psql.lua | 2 +- plugins/language_rescript.lua | 2 +- plugins/language_rivet.lua | 2 +- plugins/language_ruby.lua | 2 +- plugins/language_rust.lua | 2 +- plugins/language_sass.lua | 2 +- plugins/language_scala.lua | 114 +++++++++++++++++++------------------- plugins/language_sh.lua | 2 +- plugins/language_ssh_config.lua | 2 +- plugins/language_tcl.lua | 2 +- plugins/language_teal.lua | 2 +- plugins/language_tex.lua | 2 +- plugins/language_toml.lua | 2 +- plugins/language_ts.lua | 2 +- plugins/language_tsx.lua | 5 +- plugins/language_v.lua | 2 +- plugins/language_wren.lua | 2 +- plugins/language_yaml.lua | 2 +- plugins/language_zig.lua | 2 +- plugins/lfautoinsert.lua | 2 +- plugins/linecopypaste.lua | 2 +- plugins/linenumbers.lua | 2 +- plugins/macmodkeys.lua | 2 +- plugins/markers.lua | 2 +- plugins/memoryusage.lua | 2 +- plugins/minimap.lua | 2 +- plugins/motiontrail.lua | 2 +- plugins/navigate.lua | 2 +- plugins/nonicons.lua | 2 +- plugins/opacity.lua | 2 +- plugins/open_ext.lua | 2 +- plugins/openfilelocation.lua | 2 +- plugins/openselected.lua | 2 +- plugins/pdfview.lua | 2 +- plugins/rainbowparen.lua | 2 +- plugins/regexreplacepreview.lua | 2 +- plugins/restoretabs.lua | 2 +- plugins/scalestatus.lua | 2 +- plugins/select_colorscheme.lua | 2 +- plugins/selectionhighlight.lua | 2 +- plugins/settings.lua | 2 +- plugins/smallclock.lua | 2 +- plugins/smoothcaret.lua | 2 +- plugins/sort.lua | 2 +- plugins/spellcheck.lua | 2 +- plugins/statusclock.lua | 2 +- plugins/tabnumbers.lua | 2 +- plugins/texcompile.lua | 2 +- plugins/themeselect.lua | 2 +- plugins/titleize.lua | 2 +- plugins/togglesnakecamel.lua | 2 +- plugins/typingspeed.lua | 2 +- plugins/unboundedscroll.lua | 2 +- 117 files changed, 193 insertions(+), 192 deletions(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/autoinsert.lua b/plugins/autoinsert.lua index dd126c8..179a5ef 100644 --- a/plugins/autoinsert.lua +++ b/plugins/autoinsert.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local translate = require "core.doc.translate" local config = require "core.config" diff --git a/plugins/autosave.lua b/plugins/autosave.lua index 4501004..b63a6f6 100644 --- a/plugins/autosave.lua +++ b/plugins/autosave.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local Doc = require "core.doc" diff --git a/plugins/autosaveonfocuslost.lua b/plugins/autosaveonfocuslost.lua index 3ec97d8..1a9bd0c 100644 --- a/plugins/autosaveonfocuslost.lua +++ b/plugins/autosaveonfocuslost.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local CommandView = require "core.commandview" local DocView = require "core.docview" diff --git a/plugins/autowrap.lua b/plugins/autowrap.lua index 577a1b9..a7a9765 100644 --- a/plugins/autowrap.lua +++ b/plugins/autowrap.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local command = require "core.command" diff --git a/plugins/bigclock.lua b/plugins/bigclock.lua index 66b63f1..f3554ac 100644 --- a/plugins/bigclock.lua +++ b/plugins/bigclock.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local style = require "core.style" local command = require "core.command" diff --git a/plugins/bracketmatch.lua b/plugins/bracketmatch.lua index 5930b7b..a58c1af 100644 --- a/plugins/bracketmatch.lua +++ b/plugins/bracketmatch.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local style = require "core.style" local command = require "core.command" diff --git a/plugins/centerdoc.lua b/plugins/centerdoc.lua index 09c862a..0cea084 100644 --- a/plugins/centerdoc.lua +++ b/plugins/centerdoc.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local common = require "core.common" diff --git a/plugins/colorpreview.lua b/plugins/colorpreview.lua index fb1a738..0aa7663 100644 --- a/plugins/colorpreview.lua +++ b/plugins/colorpreview.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local config = require "core.config" local common = require "core.common" local DocView = require "core.docview" diff --git a/plugins/copyfilelocation.lua b/plugins/copyfilelocation.lua index 51bcaac..eb7b1a9 100644 --- a/plugins/copyfilelocation.lua +++ b/plugins/copyfilelocation.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index 2cbc410..28b07c8 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local command = require "core.command" diff --git a/plugins/dragdropselected.lua b/plugins/dragdropselected.lua index 18db048..ec998aa 100644 --- a/plugins/dragdropselected.lua +++ b/plugins/dragdropselected.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 --[[ dragdropselected.lua provides basic drag and drop of selected text (in same document) diff --git a/plugins/ephemeral_tabs.lua b/plugins/ephemeral_tabs.lua index e810e92..f61c493 100644 --- a/plugins/ephemeral_tabs.lua +++ b/plugins/ephemeral_tabs.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local RootView = require "core.rootview" diff --git a/plugins/eval.lua b/plugins/eval.lua index 7658298..36cc714 100644 --- a/plugins/eval.lua +++ b/plugins/eval.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" diff --git a/plugins/exec.lua b/plugins/exec.lua index 5e7ce96..29c8e85 100644 --- a/plugins/exec.lua +++ b/plugins/exec.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" diff --git a/plugins/extend_selection_line.lua b/plugins/extend_selection_line.lua index 968399c..e002674 100644 --- a/plugins/extend_selection_line.lua +++ b/plugins/extend_selection_line.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local DocView = require "core.docview" local style = require "core.style" diff --git a/plugins/fontconfig.lua b/plugins/fontconfig.lua index 6b1047c..8b713b5 100644 --- a/plugins/fontconfig.lua +++ b/plugins/fontconfig.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local subprocess = require "process" local core = require "core" diff --git a/plugins/force_syntax.lua b/plugins/force_syntax.lua index e5d17e2..48a1853 100644 --- a/plugins/force_syntax.lua +++ b/plugins/force_syntax.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local Doc = require "core.doc" local syntax = require "core.syntax" diff --git a/plugins/ghmarkdown.lua b/plugins/ghmarkdown.lua index 9a7fc00..244b144 100644 --- a/plugins/ghmarkdown.lua +++ b/plugins/ghmarkdown.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local keymap = require "core.keymap" diff --git a/plugins/gitstatus.lua b/plugins/gitstatus.lua index 9ba792c..fc7a2ea 100644 --- a/plugins/gitstatus.lua +++ b/plugins/gitstatus.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local common = require "core.common" local config = require "core.config" diff --git a/plugins/gofmt.lua b/plugins/gofmt.lua index 2f0aece..fec95e4 100644 --- a/plugins/gofmt.lua +++ b/plugins/gofmt.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local keymap = require "core.keymap" diff --git a/plugins/indent_convert.lua b/plugins/indent_convert.lua index af241a7..3a950f5 100644 --- a/plugins/indent_convert.lua +++ b/plugins/indent_convert.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local common = require "core.common" local config = require "core.config" diff --git a/plugins/indentguide.lua b/plugins/indentguide.lua index 8d78ee3..71c6269 100644 --- a/plugins/indentguide.lua +++ b/plugins/indentguide.lua @@ -1,4 +1,4 @@ ---- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local style = require "core.style" local config = require "core.config" local DocView = require "core.docview" diff --git a/plugins/language_R.lua b/plugins/language_R.lua index 8dd3779..a0bebed 100644 --- a/plugins/language_R.lua +++ b/plugins/language_R.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add{ @@ -15,7 +15,7 @@ syntax.add{ {pattern = "0x[%da-fA-F]+", type = "number"}, {pattern = "-?%d+[%d%.eE]*", type = "number"}, {pattern = "-?%.?%d+", type = "number"}, - + }, symbols = { ["TRUE"] = "literal", diff --git a/plugins/language_angelscript.lua b/plugins/language_angelscript.lua index b6e4e92..4e003ea 100644 --- a/plugins/language_angelscript.lua +++ b/plugins/language_angelscript.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_batch.lua b/plugins/language_batch.lua index c763762..32510c8 100644 --- a/plugins/language_batch.lua +++ b/plugins/language_batch.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" -- batch syntax for lite diff --git a/plugins/language_bib.lua b/plugins/language_bib.lua index 844ce76..1850ec6 100644 --- a/plugins/language_bib.lua +++ b/plugins/language_bib.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_cmake.lua b/plugins/language_cmake.lua index 3d89337..19f1aa5 100644 --- a/plugins/language_cmake.lua +++ b/plugins/language_cmake.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_cpp.lua b/plugins/language_cpp.lua index 3b8ff6c..4c66f8c 100644 --- a/plugins/language_cpp.lua +++ b/plugins/language_cpp.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" diff --git a/plugins/language_crystal.lua b/plugins/language_crystal.lua index 3c833a1..7f93c25 100644 --- a/plugins/language_crystal.lua +++ b/plugins/language_crystal.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- based on the ruby plugin, see https://github.com/Tamnac/lite-xl-plugins to contribute local syntax = require "core.syntax" diff --git a/plugins/language_csharp.lua b/plugins/language_csharp.lua index f446e51..c137b63 100644 --- a/plugins/language_csharp.lua +++ b/plugins/language_csharp.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_d.lua b/plugins/language_d.lua index 05f9a4e..6788f0b 100644 --- a/plugins/language_d.lua +++ b/plugins/language_d.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_dart.lua b/plugins/language_dart.lua index 52a2689..03274b2 100644 --- a/plugins/language_dart.lua +++ b/plugins/language_dart.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_diff.lua b/plugins/language_diff.lua index 1acc886..c4c5a90 100644 --- a/plugins/language_diff.lua +++ b/plugins/language_diff.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" local style = require "core.style" local common = require "core.common" diff --git a/plugins/language_elixir.lua b/plugins/language_elixir.lua index f1921a7..8f47770 100644 --- a/plugins/language_elixir.lua +++ b/plugins/language_elixir.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_elm.lua b/plugins/language_elm.lua index 9d3a928..2d33813 100644 --- a/plugins/language_elm.lua +++ b/plugins/language_elm.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_fe.lua b/plugins/language_fe.lua index 415ff6f..aee9b85 100644 --- a/plugins/language_fe.lua +++ b/plugins/language_fe.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_fennel.lua b/plugins/language_fennel.lua index 96283c1..9e29108 100644 --- a/plugins/language_fennel.lua +++ b/plugins/language_fennel.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Support for the Fennel programming language: https://fennel-lang.org -- Covers all the keywords up to Fennel version 0.4.0 diff --git a/plugins/language_fstab.lua b/plugins/language_fstab.lua index 869debd..bbe418e 100644 --- a/plugins/language_fstab.lua +++ b/plugins/language_fstab.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" @@ -7,7 +7,7 @@ syntax.add { files = { "fstab" }, comment = '#', patterns = { - -- Only lines that start with a # are comments; you can have #'s in fuse + -- Only lines that start with a # are comments; you can have #'s in fuse -- filesystem strings that aren't comments, so shouldn't be highlighted as such. { regex = "^#.*$", type = "comment" }, { pattern = "[=/:.,]+", type = "operator" }, @@ -45,7 +45,7 @@ syntax.add { ["LABEL"] = "keyword", ["UUID"] = "keyword", - + -- filesystems ["aufs"] = "keyword2", ["autofs"] = "keyword2", diff --git a/plugins/language_gdscript.lua b/plugins/language_gdscript.lua index 92a2b64..d03dce8 100644 --- a/plugins/language_gdscript.lua +++ b/plugins/language_gdscript.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Support for the GDScript programming language: https://godotengine.org/ -- Covers the most used keywords up to Godot version 3.2.x diff --git a/plugins/language_glsl.lua b/plugins/language_glsl.lua index 541642d..360e11f 100644 --- a/plugins/language_glsl.lua +++ b/plugins/language_glsl.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local style = require "core.style" local common = require "core.common" diff --git a/plugins/language_gmi.lua b/plugins/language_gmi.lua index d1a1fc5..c5d819a 100644 --- a/plugins/language_gmi.lua +++ b/plugins/language_gmi.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" diff --git a/plugins/language_go.lua b/plugins/language_go.lua index 151d476..1ce311e 100644 --- a/plugins/language_go.lua +++ b/plugins/language_go.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_hlsl.lua b/plugins/language_hlsl.lua index a4976d1..e1d5570 100644 --- a/plugins/language_hlsl.lua +++ b/plugins/language_hlsl.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local style = require "core.style" local common = require "core.common" diff --git a/plugins/language_hs.lua b/plugins/language_hs.lua index 60b0b8f..4271210 100644 --- a/plugins/language_hs.lua +++ b/plugins/language_hs.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_ini.lua b/plugins/language_ini.lua index 0c59224..2f5d3b5 100644 --- a/plugins/language_ini.lua +++ b/plugins/language_ini.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" diff --git a/plugins/language_java.lua b/plugins/language_java.lua index 5a81a2d..30c1249 100644 --- a/plugins/language_java.lua +++ b/plugins/language_java.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_jiyu.lua b/plugins/language_jiyu.lua index a82feca..dbf9d0e 100644 --- a/plugins/language_jiyu.lua +++ b/plugins/language_jiyu.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_jsx.lua b/plugins/language_jsx.lua index 17d949e..90d9979 100644 --- a/plugins/language_jsx.lua +++ b/plugins/language_jsx.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Almost identical to JS, with the exception that / shouldn't denote a regex. Current JS syntax highlighter will highlight half the document due to closing tags. local syntax = require "core.syntax" diff --git a/plugins/language_julia.lua b/plugins/language_julia.lua index 6dd223d..347592f 100644 --- a/plugins/language_julia.lua +++ b/plugins/language_julia.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Support for the Julia programming language: -- Covers the most used keywords up to Julia version 1.6.4 diff --git a/plugins/language_liquid.lua b/plugins/language_liquid.lua index ea8992f..ad40a79 100644 --- a/plugins/language_liquid.lua +++ b/plugins/language_liquid.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" local liquid_syntax = { @@ -92,7 +92,7 @@ local liquid_syntax = { ["upcase"] = "keyword2", ["when"] = "keyword", ["where"] = "keyword2" - + }, } @@ -102,27 +102,27 @@ syntax.add { patterns = { { pattern = { "{%%", "%%}" }, syntax = liquid_syntax, type = "function" }, { pattern = { "{{", "}}" }, syntax = liquid_syntax, type = "function" }, - { - pattern = { + { + pattern = { "<%s*[sS][cC][rR][iI][pP][tT]%s+[tT][yY][pP][eE]%s*=%s*" .. "['\"]%a+/[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]['\"]%s*>", - "<%s*/[sS][cC][rR][iI][pP][tT]>" + "<%s*/[sS][cC][rR][iI][pP][tT]>" }, - syntax = ".js", - type = "function" + syntax = ".js", + type = "function" }, - { - pattern = { + { + pattern = { "<%s*[sS][cC][rR][iI][pP][tT]%s*>", - "<%s*/%s*[sS][cC][rR][iI][pP][tT]>" + "<%s*/%s*[sS][cC][rR][iI][pP][tT]>" }, syntax = ".js", type = "function" }, - { - pattern = { - "<%s*[sS][tT][yY][lL][eE][^>]*>", - "<%s*/%s*[sS][tT][yY][lL][eE]%s*>" + { + pattern = { + "<%s*[sS][tT][yY][lL][eE][^>]*>", + "<%s*/%s*[sS][tT][yY][lL][eE]%s*>" }, syntax = ".css", type = "function" diff --git a/plugins/language_lobster.lua b/plugins/language_lobster.lua index 60f5577..24f4251 100644 --- a/plugins/language_lobster.lua +++ b/plugins/language_lobster.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { @@ -46,7 +46,7 @@ syntax.add { ["string"] = "keyword2", ["any"] = "keyword2", ["void"] = "keyword2", - + ["is"] = "keyword", ["typeof"] = "keyword", ["var"] = "keyword", @@ -59,7 +59,7 @@ syntax.add { ["not"] = "operator", ["and"] = "operator", - ["or"] = "operator", + ["or"] = "operator", ["nil"] = "literal", }, diff --git a/plugins/language_make.lua b/plugins/language_make.lua index 39bc9ab..4ad3521 100644 --- a/plugins/language_make.lua +++ b/plugins/language_make.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_meson.lua b/plugins/language_meson.lua index b8cc680..1f7f366 100644 --- a/plugins/language_meson.lua +++ b/plugins/language_meson.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_moon.lua b/plugins/language_moon.lua index 60c1dc2..8042b7d 100644 --- a/plugins/language_moon.lua +++ b/plugins/language_moon.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_nginx.lua b/plugins/language_nginx.lua index 660b529..7124c1a 100644 --- a/plugins/language_nginx.lua +++ b/plugins/language_nginx.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" -- Copied from https://github.com/shanoor/vscode-nginx/blob/master/syntaxes/nginx.tmLanguage diff --git a/plugins/language_nim.lua b/plugins/language_nim.lua index 40327e7..d7726d1 100644 --- a/plugins/language_nim.lua +++ b/plugins/language_nim.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" local patterns = {} diff --git a/plugins/language_objc.lua b/plugins/language_objc.lua index 172f895..8d1210b 100644 --- a/plugins/language_objc.lua +++ b/plugins/language_objc.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_odin.lua b/plugins/language_odin.lua index bcf054e..a5dfa45 100644 --- a/plugins/language_odin.lua +++ b/plugins/language_odin.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_perl.lua b/plugins/language_perl.lua index bd00fee..0e057e2 100644 --- a/plugins/language_perl.lua +++ b/plugins/language_perl.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_php.lua b/plugins/language_php.lua index 139da4b..d2f7643 100644 --- a/plugins/language_php.lua +++ b/plugins/language_php.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 --[[ language_php.lua provides php syntax support allowing mixed html, css and js diff --git a/plugins/language_pico8.lua b/plugins/language_pico8.lua index 7c8bd1e..aefd6f6 100644 --- a/plugins/language_pico8.lua +++ b/plugins/language_pico8.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_pkgbuild.lua b/plugins/language_pkgbuild.lua index c390c75..049a5d1 100644 --- a/plugins/language_pkgbuild.lua +++ b/plugins/language_pkgbuild.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_po.lua b/plugins/language_po.lua index db2bdf8..a1b098c 100644 --- a/plugins/language_po.lua +++ b/plugins/language_po.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_powershell.lua b/plugins/language_powershell.lua index e7c64ea..3350419 100644 --- a/plugins/language_powershell.lua +++ b/plugins/language_powershell.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_psql.lua b/plugins/language_psql.lua index 83774dc..b891dae 100644 --- a/plugins/language_psql.lua +++ b/plugins/language_psql.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" -- In sql symbols can be lower case and upper case diff --git a/plugins/language_rescript.lua b/plugins/language_rescript.lua index 34d04e9..3d3bca0 100644 --- a/plugins/language_rescript.lua +++ b/plugins/language_rescript.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_rivet.lua b/plugins/language_rivet.lua index 58cdedf..30d5e4e 100644 --- a/plugins/language_rivet.lua +++ b/plugins/language_rivet.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Syntax highlighting for the Rivet programming language. -- by StunxFS :) diff --git a/plugins/language_ruby.lua b/plugins/language_ruby.lua index f4e8e73..af700c2 100644 --- a/plugins/language_ruby.lua +++ b/plugins/language_ruby.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_rust.lua b/plugins/language_rust.lua index 9071db6..44a9980 100644 --- a/plugins/language_rust.lua +++ b/plugins/language_rust.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_sass.lua b/plugins/language_sass.lua index 92c6fec..f440927 100644 --- a/plugins/language_sass.lua +++ b/plugins/language_sass.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_scala.lua b/plugins/language_scala.lua index c3dd943..6c5d7a7 100644 --- a/plugins/language_scala.lua +++ b/plugins/language_scala.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { @@ -19,62 +19,62 @@ syntax.add { { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { - ["abstract"] = "keyword", - ["case"] = "keyword", - ["catch"] = "keyword", - ["class"] = "keyword", - ["finally"] = "keyword", - ["final"] = "keyword", - ["do"] = "keyword", - ["extends"] = "keyword", - ["forSome"] = "keyword", - ["implicit"] = "keyword", - ["lazy"] = "keyword", - ["match"] = "keyword", - ["new"] = "keyword", - ["override"] = "keyword", - ["package"] = "keyword", - ["throw"] = "keyword", - ["trait"] = "keyword", - ["type"] = "keyword", - ["var"] = "keyword", - ["val"] = "keyword", + ["abstract"] = "keyword", + ["case"] = "keyword", + ["catch"] = "keyword", + ["class"] = "keyword", + ["finally"] = "keyword", + ["final"] = "keyword", + ["do"] = "keyword", + ["extends"] = "keyword", + ["forSome"] = "keyword", + ["implicit"] = "keyword", + ["lazy"] = "keyword", + ["match"] = "keyword", + ["new"] = "keyword", + ["override"] = "keyword", + ["package"] = "keyword", + ["throw"] = "keyword", + ["trait"] = "keyword", + ["type"] = "keyword", + ["var"] = "keyword", + ["val"] = "keyword", ["println"] = "keyword", - ["return"] = "keyword", - ["for"] = "keyword", - ["Try"] = "keyword", - ["def"] = "keyword", - ["while"] = "keyword", - ["with"] = "keyword", - ["if"] = "keyword", - ["else"] = "keyword", - ["import"] = "keyword", - ["object"] = "keyword", - ["yield"] = "keyword", - - ["private"] = "keyword2", - ["protected"] = "keyword2", - ["sealed"] = "keyword2", - ["super"] = "keyword2", - ["this"] = "keyword2", - ["Byte"] = "keyword2", - ["Short"] = "keyword2", - ["Int"] = "keyword2", - ["Long"] = "keyword2", - ["Float"] = "keyword2", - ["Double"] = "keyword2", - ["Char"] = "keyword2", - ["String"] = "keyword2", - ["List"] = "keyword2", - ["Array"] = "keyword2", - ["Boolean"] = "keyword2", - - ["Null"] = "literal", - ["Any"] = "literal", - ["AnyRef"] = "literal", - ["Nothing"] = "literal", - ["Unit"] = "literal", - ["true"] = "literal", - ["false"] = "literal", + ["return"] = "keyword", + ["for"] = "keyword", + ["Try"] = "keyword", + ["def"] = "keyword", + ["while"] = "keyword", + ["with"] = "keyword", + ["if"] = "keyword", + ["else"] = "keyword", + ["import"] = "keyword", + ["object"] = "keyword", + ["yield"] = "keyword", + + ["private"] = "keyword2", + ["protected"] = "keyword2", + ["sealed"] = "keyword2", + ["super"] = "keyword2", + ["this"] = "keyword2", + ["Byte"] = "keyword2", + ["Short"] = "keyword2", + ["Int"] = "keyword2", + ["Long"] = "keyword2", + ["Float"] = "keyword2", + ["Double"] = "keyword2", + ["Char"] = "keyword2", + ["String"] = "keyword2", + ["List"] = "keyword2", + ["Array"] = "keyword2", + ["Boolean"] = "keyword2", + + ["Null"] = "literal", + ["Any"] = "literal", + ["AnyRef"] = "literal", + ["Nothing"] = "literal", + ["Unit"] = "literal", + ["true"] = "literal", + ["false"] = "literal", } } diff --git a/plugins/language_sh.lua b/plugins/language_sh.lua index c72f2c3..5d7b987 100644 --- a/plugins/language_sh.lua +++ b/plugins/language_sh.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_ssh_config.lua b/plugins/language_ssh_config.lua index cb05049..894ce21 100644 --- a/plugins/language_ssh_config.lua +++ b/plugins/language_ssh_config.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_tcl.lua b/plugins/language_tcl.lua index 5811de6..7a6e13f 100644 --- a/plugins/language_tcl.lua +++ b/plugins/language_tcl.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_teal.lua b/plugins/language_teal.lua index 62b4351..0b0e35d 100644 --- a/plugins/language_teal.lua +++ b/plugins/language_teal.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_tex.lua b/plugins/language_tex.lua index c564baa..e34d466 100644 --- a/plugins/language_tex.lua +++ b/plugins/language_tex.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_toml.lua b/plugins/language_toml.lua index da5e9b8..02e5b58 100644 --- a/plugins/language_toml.lua +++ b/plugins/language_toml.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" diff --git a/plugins/language_ts.lua b/plugins/language_ts.lua index b5574fa..f28261d 100644 --- a/plugins/language_ts.lua +++ b/plugins/language_ts.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- copied from language_js, but added regex highlighting back local syntax = require "core.syntax" diff --git a/plugins/language_tsx.lua b/plugins/language_tsx.lua index 11ba09a..beedbc6 100644 --- a/plugins/language_tsx.lua +++ b/plugins/language_tsx.lua @@ -1,5 +1,6 @@ --- mod-version:3 --lite-xl 2.1 --- Almost identical to JS, with the exception that / shouldn't denote a regex. Current JS syntax highlighter will highlight half the document due to closing tags. +-- mod-version:3 +-- Almost identical to JS, with the exception that / shouldn't denote a regex. +-- Current JS syntax highlighter will highlight half the document due to closing tags. local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_v.lua b/plugins/language_v.lua index 1336e95..c7876e6 100644 --- a/plugins/language_v.lua +++ b/plugins/language_v.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_wren.lua b/plugins/language_wren.lua index f5d75e8..42f4fbd 100644 --- a/plugins/language_wren.lua +++ b/plugins/language_wren.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/language_yaml.lua b/plugins/language_yaml.lua index fdc26fa..8b7f634 100644 --- a/plugins/language_yaml.lua +++ b/plugins/language_yaml.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" local yaml_bracket_list = { diff --git a/plugins/language_zig.lua b/plugins/language_zig.lua index 9152d3f..f2c32d5 100644 --- a/plugins/language_zig.lua +++ b/plugins/language_zig.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local syntax = require "core.syntax" syntax.add { diff --git a/plugins/lfautoinsert.lua b/plugins/lfautoinsert.lua index 1d9772d..ae3da75 100644 --- a/plugins/lfautoinsert.lua +++ b/plugins/lfautoinsert.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local common = require "core.common" diff --git a/plugins/linecopypaste.lua b/plugins/linecopypaste.lua index 23933a1..7be8492 100644 --- a/plugins/linecopypaste.lua +++ b/plugins/linecopypaste.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" diff --git a/plugins/linenumbers.lua b/plugins/linenumbers.lua index 5cf198a..03b5fb2 100644 --- a/plugins/linenumbers.lua +++ b/plugins/linenumbers.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local config = require "core.config" local style = require "core.style" local DocView = require "core.docview" diff --git a/plugins/macmodkeys.lua b/plugins/macmodkeys.lua index f49698e..e4656b9 100644 --- a/plugins/macmodkeys.lua +++ b/plugins/macmodkeys.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local keymap = require "core.keymap" local on_key_pressed = keymap.on_key_pressed diff --git a/plugins/markers.lua b/plugins/markers.lua index 176eff1..e2ec68e 100644 --- a/plugins/markers.lua +++ b/plugins/markers.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Markers plugin for lite text editor -- original implementation by Petri Häkkinen diff --git a/plugins/memoryusage.lua b/plugins/memoryusage.lua index a8b8005..d84a8c2 100644 --- a/plugins/memoryusage.lua +++ b/plugins/memoryusage.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- original implementation by AqilCont local core = require "core" local config = require "core.config" diff --git a/plugins/minimap.lua b/plugins/minimap.lua index 932f9dd..feaded2 100644 --- a/plugins/minimap.lua +++ b/plugins/minimap.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local common = require "core.common" diff --git a/plugins/motiontrail.lua b/plugins/motiontrail.lua index cc94ca9..16e7307 100644 --- a/plugins/motiontrail.lua +++ b/plugins/motiontrail.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local common = require "core.common" diff --git a/plugins/navigate.lua b/plugins/navigate.lua index 373fe83..d83c02f 100644 --- a/plugins/navigate.lua +++ b/plugins/navigate.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local common = require "core.common" diff --git a/plugins/nonicons.lua b/plugins/nonicons.lua index e249508..9540ce6 100644 --- a/plugins/nonicons.lua +++ b/plugins/nonicons.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Author: Jipok -- Doesn't work well with scaling mode == "ui" diff --git a/plugins/opacity.lua b/plugins/opacity.lua index f3a9d81..a97cae9 100644 --- a/plugins/opacity.lua +++ b/plugins/opacity.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local common = require "core.common" local command = require "core.command" diff --git a/plugins/open_ext.lua b/plugins/open_ext.lua index 1f6b19c..4c57d68 100644 --- a/plugins/open_ext.lua +++ b/plugins/open_ext.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- The general idea is to check if the file opened is valid utf-8 -- since lite-xl only supports UTF8 text, others can be safely assumed diff --git a/plugins/openfilelocation.lua b/plugins/openfilelocation.lua index 8e225cd..603c7b6 100644 --- a/plugins/openfilelocation.lua +++ b/plugins/openfilelocation.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local common = require "core.common" local command = require "core.command" diff --git a/plugins/openselected.lua b/plugins/openselected.lua index 7df4dba..6333da9 100644 --- a/plugins/openselected.lua +++ b/plugins/openselected.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local keymap = require "core.keymap" diff --git a/plugins/pdfview.lua b/plugins/pdfview.lua index 1634058..199584e 100644 --- a/plugins/pdfview.lua +++ b/plugins/pdfview.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local keymap = require "core.keymap" diff --git a/plugins/rainbowparen.lua b/plugins/rainbowparen.lua index 04cdfaf..0f4c5c8 100644 --- a/plugins/rainbowparen.lua +++ b/plugins/rainbowparen.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local style = require "core.style" local config = require "core.config" diff --git a/plugins/regexreplacepreview.lua b/plugins/regexreplacepreview.lua index 0900480..85845ad 100644 --- a/plugins/regexreplacepreview.lua +++ b/plugins/regexreplacepreview.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local keymap = require "core.keymap" local command = require "core.command" diff --git a/plugins/restoretabs.lua b/plugins/restoretabs.lua index 5c06e80..4c33304 100644 --- a/plugins/restoretabs.lua +++ b/plugins/restoretabs.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 -- Not perfect, because we can't actually figure out when something closes, but should be good enough, so long as we check the list of open views. -- Maybe find a better way to get at "Node"? local core = require "core" diff --git a/plugins/scalestatus.lua b/plugins/scalestatus.lua index 2379ed4..aa08cdc 100644 --- a/plugins/scalestatus.lua +++ b/plugins/scalestatus.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 --[[ scalestatus.lua displays current scale (zoom) in status view diff --git a/plugins/select_colorscheme.lua b/plugins/select_colorscheme.lua index b1e8b6e..4406aa1 100644 --- a/plugins/select_colorscheme.lua +++ b/plugins/select_colorscheme.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local common = require "core.common" diff --git a/plugins/selectionhighlight.lua b/plugins/selectionhighlight.lua index d17acff..133dced 100644 --- a/plugins/selectionhighlight.lua +++ b/plugins/selectionhighlight.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local style = require "core.style" local DocView = require "core.docview" diff --git a/plugins/settings.lua b/plugins/settings.lua index e568c48..bffb697 100644 --- a/plugins/settings.lua +++ b/plugins/settings.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 --priority:0 +-- mod-version:3 --priority:0 local core = require "core" local config = require "core.config" local common = require "core.common" diff --git a/plugins/smallclock.lua b/plugins/smallclock.lua index 7bc756c..7c845d7 100644 --- a/plugins/smallclock.lua +++ b/plugins/smallclock.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local common = require "core.common" diff --git a/plugins/smoothcaret.lua b/plugins/smoothcaret.lua index 3a30d5b..5639ff2 100644 --- a/plugins/smoothcaret.lua +++ b/plugins/smoothcaret.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local style = require "core.style" diff --git a/plugins/sort.lua b/plugins/sort.lua index a729624..1ad4034 100644 --- a/plugins/sort.lua +++ b/plugins/sort.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local translate = require "core.doc.translate" diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 0f79cab..23a5fa9 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local style = require "core.style" local config = require "core.config" diff --git a/plugins/statusclock.lua b/plugins/statusclock.lua index 6d37b37..0fe95dd 100644 --- a/plugins/statusclock.lua +++ b/plugins/statusclock.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local style = require "core.style" diff --git a/plugins/tabnumbers.lua b/plugins/tabnumbers.lua index 3a842b7..97e5d10 100644 --- a/plugins/tabnumbers.lua +++ b/plugins/tabnumbers.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local config = require "core.config" local common = require "core.common" local style = require "core.style" diff --git a/plugins/texcompile.lua b/plugins/texcompile.lua index 9eb30c5..af31aed 100644 --- a/plugins/texcompile.lua +++ b/plugins/texcompile.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local config = require "core.config" local command = require "core.command" diff --git a/plugins/themeselect.lua b/plugins/themeselect.lua index 05af749..6a06715 100644 --- a/plugins/themeselect.lua +++ b/plugins/themeselect.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" -- Load a specific theme when the filename of an active document does match diff --git a/plugins/titleize.lua b/plugins/titleize.lua index b329671..16d20b0 100644 --- a/plugins/titleize.lua +++ b/plugins/titleize.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" diff --git a/plugins/togglesnakecamel.lua b/plugins/togglesnakecamel.lua index cd68bba..c055933 100644 --- a/plugins/togglesnakecamel.lua +++ b/plugins/togglesnakecamel.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local core = require "core" local command = require "core.command" local keymap = require "core.keymap" diff --git a/plugins/typingspeed.lua b/plugins/typingspeed.lua index d639252..14bd91c 100644 --- a/plugins/typingspeed.lua +++ b/plugins/typingspeed.lua @@ -1,4 +1,4 @@ --- mod-version:2 +-- mod-version:3 local core = require "core" local style = require "core.style" diff --git a/plugins/unboundedscroll.lua b/plugins/unboundedscroll.lua index 93f8144..0793cfa 100644 --- a/plugins/unboundedscroll.lua +++ b/plugins/unboundedscroll.lua @@ -1,4 +1,4 @@ --- mod-version:3 --lite-xl 2.1 +-- mod-version:3 local command = require "core.command" local DocView = require "core.docview" -- cgit v1.2.3 From 49fc493834c9b450ed102e261e65577a88291008 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Thu, 16 Jun 2022 00:32:07 -0400 Subject: updates to new command_view:enter interface --- plugins/datetimestamps.lua | 8 +++++--- plugins/eval.lua | 20 ++++++++++++-------- plugins/exec.lua | 26 +++++++++++++++----------- plugins/regexreplacepreview.lua | 11 +++++------ plugins/select_colorscheme.lua | 4 +++- plugins/spellcheck.lua | 23 +++++++++++++---------- 6 files changed, 53 insertions(+), 39 deletions(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index 28b07c8..f16af83 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -77,9 +77,11 @@ command.add("core.docview", { ["datetimestamps:insert-timestamp"] = timestamp, ["datetimestamps:insert-datetimestamp"] = datetimestamp, ["datetimestamps:insert-custom"] = function() - core.command_view:enter("Date format eg: %H:%M:%S", function(cmd) - core.active_view.doc:text_input(os.date(cmd) or "") - end) + core.command_view:enter("Date format eg: %H:%M:%S", { + submit = function(cmd) + core.active_view.doc:text_input(os.date(cmd) or "") + end + }) end, }) diff --git a/plugins/eval.lua b/plugins/eval.lua index 36cc714..c2eb19e 100644 --- a/plugins/eval.lua +++ b/plugins/eval.lua @@ -13,16 +13,20 @@ end command.add("core.docview", { ["eval:insert"] = function() - core.command_view:enter("Evaluate And Insert Result", function(cmd) - core.active_view.doc:text_input(eval(cmd)) - end) + core.command_view:enter("Evaluate And Insert Result", { + submit = function(cmd) + core.active_view.doc:text_input(eval(cmd)) + end + }) end, ["eval:replace"] = function() - core.command_view:enter("Evaluate And Replace With Result", function(cmd) - core.active_view.doc:replace(function(str) - return eval(cmd) - end) - end) + core.command_view:enter("Evaluate And Replace With Result", { + submit = function(cmd) + core.active_view.doc:replace(function(str) + return eval(cmd) + end) + end + }) end, }) diff --git a/plugins/exec.lua b/plugins/exec.lua index 29c8e85..b8f61c5 100644 --- a/plugins/exec.lua +++ b/plugins/exec.lua @@ -28,19 +28,23 @@ end command.add("core.docview", { ["exec:insert"] = function() - core.command_view:enter("Insert Result Of Command", function(cmd) - core.active_view.doc:text_input(exec(cmd)) - end) + core.command_view:enter("Insert Result Of Command", { + submit = function(cmd) + core.active_view.doc:text_input(exec(cmd)) + end + }) end, ["exec:replace"] = function() - core.command_view:enter("Replace With Result Of Command", function(cmd) - core.active_view.doc:replace(function(str) - return exec( - "printf %b " .. printfb_quote(str:gsub("%\n$", "") .. "\n") .. " | eval '' " .. shell_quote(cmd), - str:find("%\n$") - ) - end) - end) + core.command_view:enter("Replace With Result Of Command", { + submit = function(cmd) + core.active_view.doc:replace(function(str) + return exec( + "printf %b " .. printfb_quote(str:gsub("%\n$", "") .. "\n") .. " | eval '' " .. shell_quote(cmd), + str:find("%\n$") + ) + end) + end + }) end, }) diff --git a/plugins/regexreplacepreview.lua b/plugins/regexreplacepreview.lua index 7ca8bc1..8abd39c 100644 --- a/plugins/regexreplacepreview.lua +++ b/plugins/regexreplacepreview.lua @@ -95,12 +95,11 @@ command.add("core.docview", { local doc = view.doc local original_selection = { doc:get_selection(true) } local selection = doc:has_selection() and { doc:get_selection(true) } or {} - core.command_view:enter( - "Regex Replace (enter pattern as /old/new/)", - function(pattern) + core.command_view:enter("Regex Replace (enter pattern as /old/new/)", { + submit = function(pattern) regex_replace_file(view, pattern, {}, false, selection[1], selection[3]) end, - function(pattern) + suggest = function(pattern) local incremental, has_replacement = regex_replace_file( view, pattern, old_lines, true, selection[1], selection[3] ) @@ -111,7 +110,7 @@ command.add("core.docview", { doc:set_selection(table.unpack(original_selection)) end end, - function(pattern) + cancel = function(pattern) for k,v in pairs(old_lines) do if v then if k == #doc.lines then @@ -124,7 +123,7 @@ command.add("core.docview", { end doc:set_selection(table.unpack(original_selection)) end - ) + }) end }) diff --git a/plugins/select_colorscheme.lua b/plugins/select_colorscheme.lua index 0d60251..6fa45d4 100644 --- a/plugins/select_colorscheme.lua +++ b/plugins/select_colorscheme.lua @@ -122,7 +122,9 @@ end command.add(nil, { ["ui:color scheme"] = function() - core.command_view:enter("Select color scheme", color_scheme_submit, color_scheme_suggest) + core.command_view:enter("Select color scheme", { + submit = color_scheme_submit, suggest = color_scheme_suggest + }) end, }) -- ---------------------------------------------------------------- diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 23a5fa9..cd3e0f1 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -214,18 +214,21 @@ command.add("core.docview", { -- select word and init replacement selector local label = string.format("Replace \"%s\" With", word) doc:set_selection(line, e + 1, line, s) - core.command_view:enter(label, function(text, item) - text = item and item.text or text - doc:replace(function() return text end) - end, function(text) - local t = {} - for _, w in ipairs(suggestions) do - if w:lower():find(text:lower(), 1, true) then - table.insert(t, w) + core.command_view:enter(label, { + submit = function(text, item) + text = item and item.text or text + doc:replace(function() return text end) + end, + suggest = function(text) + local t = {} + for _, w in ipairs(suggestions) do + if w:lower():find(text:lower(), 1, true) then + table.insert(t, w) + end end + return t end - return t - end) + }) end, }) -- cgit v1.2.3 From 07c0d2cfc15c8254bc3e66c88b9e3f33e7ee9e32 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Fri, 16 Sep 2022 10:49:46 -0400 Subject: spellcheck: updated config spec to support file type --- plugins/spellcheck.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/spellcheck.lua') diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index cd3e0f1..f55cf1f 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -148,7 +148,8 @@ config.plugins.spellcheck.config_spec = { label = "Dictionary File", description = "Path to a text file that contains a list of dictionary words.", path = "dictionary_file", - type = "string", + type = "file", + exists = true, default = platform_dictionary_file, on_apply = function() load_dictionary() -- cgit v1.2.3