diff options
author | rxi <rxi@users.noreply.github.com> | 2020-05-22 16:03:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-22 16:03:51 +0100 |
commit | 9be88f889536e82a22a304f5a576624f33b9bf10 (patch) | |
tree | 383c7b171d321e8cbe4804cc8cb89784469f9929 | |
parent | e068564f2455d457d1e60c058cd55668c4bc88e6 (diff) | |
parent | c28b35783a4df20aaa79ca9d329efec3bd4b3ee2 (diff) | |
download | lite-xl-plugins-9be88f889536e82a22a304f5a576624f33b9bf10.tar.gz lite-xl-plugins-9be88f889536e82a22a304f5a576624f33b9bf10.zip |
Merge pull request #42 from mundusnine/master
Modifications for spellchecking on Windows
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | plugins/spellcheck.lua | 8 |
2 files changed, 7 insertions, 3 deletions
@@ -50,7 +50,7 @@ Plugin | Description [`openselected`](plugins/openselected.lua?raw=1) | Opens the selected filename or url [`selectionhighlight`](plugins/selectionhighlight.lua?raw=1) | Highlights regions of code that match the current selection *([screenshot](https://user-images.githubusercontent.com/3920290/80710883-5f597c80-8ae7-11ea-97f0-76dfacc08439.png))* [`sort`](plugins/sort.lua?raw=1) | Sorts selected lines alphabetically -[`spellcheck`](plugins/spellcheck.lua?raw=1) | Underlines misspelt words *([screenshot](https://user-images.githubusercontent.com/3920290/79923973-9caa7400-842e-11ea-85d4-7a196a91ca50.png))* +[`spellcheck`](plugins/spellcheck.lua?raw=1) | Underlines misspelt words *([screenshot](https://user-images.githubusercontent.com/3920290/79923973-9caa7400-842e-11ea-85d4-7a196a91ca50.png))* On Windows no dictionary file exists for spellchecking. You can add a words.txt file beside the exe to remedy this. [Example file](https://github.com/dwyl/english-words/blob/master/words.txt) [`theme16`](https://github.com/monolifed/theme16)* | Theme manager with base16 themes [`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` diff --git a/plugins/spellcheck.lua b/plugins/spellcheck.lua index 64cd6f3..1f29792 100644 --- a/plugins/spellcheck.lua +++ b/plugins/spellcheck.lua @@ -7,7 +7,12 @@ local DocView = require "core.docview" local Doc = require "core.doc" config.spellcheck_files = { "%.txt$", "%.md$", "%.markdown$" } -config.dictionary_file = "/usr/share/dict/words" +if PLATFORM == "Windows" then + config.dictionary_file = EXEDIR .. "/words.txt" +else + config.dictionary_file = "/usr/share/dict/words" +end + local last_input_time = 0 local word_pattern = "%a+" @@ -172,4 +177,3 @@ command.add("core.docview", { end, }) - |