aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2021-03-13 13:35:13 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2021-03-13 13:35:13 +0100
commit355954495eb9398352f7044c1661d8758a32ff73 (patch)
treefbe9209b149b91cc6ea5eb9b0b15f3116a9b1b78
parentd3d1df77289cc0fca3d70bba6d64d6be064413db (diff)
parentedf05b25dd6384733aa94dfb7ecb9b176e70975d (diff)
downloadlite-xl-plugins-355954495eb9398352f7044c1661d8758a32ff73.tar.gz
lite-xl-plugins-355954495eb9398352f7044c1661d8758a32ff73.zip
Merge remote-tracking branch 'rxi/master'
-rw-r--r--README.md3
-rw-r--r--plugins/closeconfirmx.lua54
-rw-r--r--plugins/language_csharp.lua10
3 files changed, 66 insertions, 1 deletions
diff --git a/README.md b/README.md
index a4bf53d..6d5c740 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@ Plugin | Description
[`black`](https://git.sr.ht/~tmpod/black-lite)* | Integrates the [black](https://github.com/psf/black) Python formatter with lite
[`bracketmatch`](plugins/bracketmatch.lua?raw=1) | Underlines matching pair for bracket under the caret *([screenshot](https://user-images.githubusercontent.com/3920290/80132745-0c863f00-8594-11ea-8875-c455c6fd7eae.png))*
[`centerdoc`](plugins/centerdoc.lua?raw=1) | Centers document's content on the screen *([screenshot](https://user-images.githubusercontent.com/3920290/82127896-bf6e4500-97ae-11ea-97fc-ba9a552bc9a4.png))*
+[`closeconfirmx`](plugins/closeconfirmx.lua?raw=1) | Replaces a system close confirmation dialog with a command view, like for individual files *([screenshot](https://user-images.githubusercontent.com/1689801/107596774-afa76280-6c53-11eb-80ab-22e73058c097.png))*
[`colorpreview`](plugins/colorpreview.lua?raw=1) | Underlays color values (eg. `#ff00ff` or `rgb(255, 0, 255)`) with their resultant color. *([screenshot](https://user-images.githubusercontent.com/3920290/80743752-731bd780-8b15-11ea-97d3-847db927c5dc.png))*
[`console (adapted for lite-xl)`](https://github.com/franko/console)* | A console for running external commands and capturing their output *([gif](https://user-images.githubusercontent.com/3920290/81343656-49325a00-90ad-11ea-8647-ff39d8f1d730.gif))*
[`copyfilelocation`](plugins/copyfilelocation.lua?raw=1) | Copy file location to clipboard
@@ -75,6 +76,7 @@ Plugin | Description
[`macmodkeys`](plugins/macmodkeys.lua?raw=1) | Remaps mac modkeys `command/option` to `ctrl/alt`
[`markers`](plugins/markers.lua?raw=1) | Add markers to docs and jump between them quickly *([screenshot](https://user-images.githubusercontent.com/3920290/82252149-5faaa200-9946-11ea-9199-bea2efb7ee23.png))*
[`motiontrail`](plugins/motiontrail.lua?raw=1) | Adds a motion-trail to the caret *([screenshot](https://user-images.githubusercontent.com/3920290/83256814-085ccb00-a1ab-11ea-9e35-e6633cbed1a9.gif))*
+[`nagbar`](https://github.com/takase1121/lite-nagbar)* | consistent and _beautiful_ confirmation dialogs for lite and lite-xl *([gif](https://raw.githubusercontent.com/takase1121/lite-nagbar/master/assets/preview.gif))*
[`openfilelocation`](plugins/openfilelocation.lua?raw=1) | Opens the parent directory of the current file in the file manager
[`openselected`](plugins/openselected.lua?raw=1) | Opens the selected filename or url
~~[`projectmanager`]~~(plugins/projectmanager.lua?raw=1) | Superseded by lite-xl implementation ~~Save projects and load/reload them quickly~~
@@ -86,6 +88,7 @@ Plugin | Description
[`spellcheck`](plugins/spellcheck.lua?raw=1) | Underlines misspelt words *([screenshot](https://user-images.githubusercontent.com/3920290/79923973-9caa7400-842e-11ea-85d4-7a196a91ca50.png))* *— note: on Windows a [`words.txt`](https://github.com/dwyl/english-words/blob/master/words.txt) dictionary file must be placed beside the exe*
[`tabnumbers`](plugins/tabnumbers.lua?raw=1) | Displays tab numbers from 1–9 next to their names *([screenshot](https://user-images.githubusercontent.com/16415678/101285362-007a8500-37e5-11eb-869b-c10eb9d9d902.png))
[`theme16`](https://github.com/monolifed/theme16)* | Theme manager with base16 themes
+[`themescheduler`](https://github.com/BenStigsen/lite-config/blob/main/plugins/themescheduler.lua?raw=1) | Schedule themes to be used at certain times
[`titleize`](plugins/titleize.lua?raw=1) | Titleizes selected string (`hello world` => `Hello World`)
[`todotreeview`](https://github.com/drmargarido/TodoTreeView)* | Todo tree viewer for annotations in code like `TODO`, `BUG`, `FIX`, `IMPROVEMENT`
[`togglesnakecamel`](plugins/togglesnakecamel.lua?raw=1) | Toggles symbols between `snake_case` and `camelCase`
diff --git a/plugins/closeconfirmx.lua b/plugins/closeconfirmx.lua
new file mode 100644
index 0000000..805fe3b
--- /dev/null
+++ b/plugins/closeconfirmx.lua
@@ -0,0 +1,54 @@
+-- CloseConfirmX plugin for lite text editor
+-- implementation by chekoopa
+
+local core = require "core"
+local config = require "core.config"
+
+config.closeconfirmx_use_legacy = false
+config.closeconfirmx_use_short_name = true
+
+local legacy_confirm = core.confirm_close_all
+
+local function commandful_confirm()
+ local dirty_count = 0
+ local dirty_name
+ for _, doc in ipairs(core.docs) do
+ if doc:is_dirty() then
+ dirty_count = dirty_count + 1
+ dirty_name = doc:get_name()
+ end
+ end
+ if dirty_count > 0 then
+ local text
+ if dirty_count == 1 then
+ if config.closeconfirmx_use_short_name then
+ dirty_name = dirty_name:match("[^/%\\]*$")
+ end
+ text = string.format("Unsaved changes in \"%s\"; Confirm Exit", dirty_name)
+ else
+ text = string.format("Unsaved changes in %d docs; Confirm Exit", dirty_count)
+ end
+ core.command_view:enter(text, function(_, item)
+ if item.text:match("^[cC]") then
+ core.quit(true)
+ end
+ end, function(text)
+ local items = {}
+ if not text:find("^[^sS]") then table.insert(items, "Stay here") end
+ if not text:find("^[^cC]") then table.insert(items, "Close Without Saving") end
+ return items
+ end)
+ -- as we delegate a choice inside the callback,
+ return false
+ end
+ return true
+end
+
+function core.confirm_close_all()
+ if config.closeconfirmx_use_legacy then
+ return legacy_confirm()
+ else
+ return commandful_confirm()
+ end
+end
+
diff --git a/plugins/language_csharp.lua b/plugins/language_csharp.lua
index 5e790e3..c40009c 100644
--- a/plugins/language_csharp.lua
+++ b/plugins/language_csharp.lua
@@ -21,9 +21,10 @@ syntax.add {
{ pattern = "[%a_][%w_]*", type = "symbol" },
},
symbols = {
- -- keywords
+ -- keywords and contextual keywords
["abstract"] = "keyword",
["as"] = "keyword",
+ ["add"] = "keyword",
["await"] = "keyword",
["base"] = "keyword",
["break"] = "keyword",
@@ -31,6 +32,7 @@ syntax.add {
["catch"] = "keyword",
["checked"] = "keyword",
["class"] = "keyword",
+ ["record"] = "keyword",
["const"] = "keyword",
["continue"] = "keyword",
["default"] = "keyword",
@@ -59,9 +61,12 @@ syntax.add {
["operator"] = "keyword",
["out"] = "keyword",
["override"] = "keyword",
+ ["remove"] = "keyword",
["params"] = "keyword",
+ ["partial"] = "keyword",
["private"] = "keyword",
["protected"] = "keyword",
+ ["dynamic"] = "keyword",
["public"] = "keyword",
["readonly"] = "keyword",
["ref"] = "keyword",
@@ -81,10 +86,13 @@ syntax.add {
["unsafe"] = "keyword",
["using"] = "keyword",
["var"] = "keyword",
+ ["value"] = "keyword",
+ ["global"] = "keyword",
["virtual"] = "keyword",
["void"] = "keyword",
["volatile"] = "keyword",
["where"] = "keyword",
+ ["when"] = "keyword",
["while"] = "keyword",
["yield"] = "keyword",
-- types