aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-22 16:03:51 +0100
committerGitHub <noreply@github.com>2020-05-22 16:03:51 +0100
commit9be88f889536e82a22a304f5a576624f33b9bf10 (patch)
tree383c7b171d321e8cbe4804cc8cb89784469f9929
parente068564f2455d457d1e60c058cd55668c4bc88e6 (diff)
parentc28b35783a4df20aaa79ca9d329efec3bd4b3ee2 (diff)
downloadlite-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.md2
-rw-r--r--plugins/spellcheck.lua8
2 files changed, 7 insertions, 3 deletions
diff --git a/README.md b/README.md
index 5e5132a..fa5e3a9 100644
--- a/README.md
+++ b/README.md
@@ -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,
})
-