mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(spell): save spell files to stdpath('data')/site/spell #33528
This commit is contained in:
@@ -186,7 +186,7 @@ CHANGED FEATURES *news-changed*
|
|||||||
|
|
||||||
These existing features changed their behavior.
|
These existing features changed their behavior.
|
||||||
|
|
||||||
• 'spellfile' location defaults to `stdpath("data").."/spell/"` instead of the
|
• 'spellfile' location defaults to `stdpath("data").."/site/spell/"` instead of the
|
||||||
first writable directoy in 'runtimepath'.
|
first writable directoy in 'runtimepath'.
|
||||||
• |vim.version.range()| doesn't exclude `to` if it is equal to `from`.
|
• |vim.version.range()| doesn't exclude `to` if it is equal to `from`.
|
||||||
|
|
||||||
|
@@ -5795,7 +5795,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|zg| and |zw| commands can be used to access each. This allows using
|
|zg| and |zw| commands can be used to access each. This allows using
|
||||||
a personal word list file and a project word list file.
|
a personal word list file and a project word list file.
|
||||||
When a word is added while this option is empty Nvim will use
|
When a word is added while this option is empty Nvim will use
|
||||||
(and auto-create) `stdpath('data')/spell/`. For the file name the
|
(and auto-create) `stdpath('data')/site/spell/`. For the file name the
|
||||||
first language name that appears in 'spelllang' is used, ignoring the
|
first language name that appears in 'spelllang' is used, ignoring the
|
||||||
region.
|
region.
|
||||||
The resulting ".spl" file will be used for spell checking, it does not
|
The resulting ".spl" file will be used for spell checking, it does not
|
||||||
|
@@ -79,7 +79,7 @@ Defaults *defaults* *nvim-defaults*
|
|||||||
- 'showcmd' is enabled
|
- 'showcmd' is enabled
|
||||||
- 'sidescroll' defaults to 1
|
- 'sidescroll' defaults to 1
|
||||||
- 'smarttab' is enabled
|
- 'smarttab' is enabled
|
||||||
- 'spellfile' defaults to `stdpath("data").."/spell/"`
|
- 'spellfile' defaults to `stdpath("data").."/site/spell/"`
|
||||||
- 'startofline' is disabled
|
- 'startofline' is disabled
|
||||||
- 'switchbuf' defaults to "uselast"
|
- 'switchbuf' defaults to "uselast"
|
||||||
- 'tabpagemax' defaults to 50
|
- 'tabpagemax' defaults to 50
|
||||||
|
2
runtime/lua/vim/_meta/options.lua
generated
2
runtime/lua/vim/_meta/options.lua
generated
@@ -6169,7 +6169,7 @@ vim.bo.spc = vim.bo.spellcapcheck
|
|||||||
--- `zg` and `zw` commands can be used to access each. This allows using
|
--- `zg` and `zw` commands can be used to access each. This allows using
|
||||||
--- a personal word list file and a project word list file.
|
--- a personal word list file and a project word list file.
|
||||||
--- When a word is added while this option is empty Nvim will use
|
--- When a word is added while this option is empty Nvim will use
|
||||||
--- (and auto-create) `stdpath('data')/spell/`. For the file name the
|
--- (and auto-create) `stdpath('data')/site/spell/`. For the file name the
|
||||||
--- first language name that appears in 'spelllang' is used, ignoring the
|
--- first language name that appears in 'spelllang' is used, ignoring the
|
||||||
--- region.
|
--- region.
|
||||||
--- The resulting ".spl" file will be used for spell checking, it does not
|
--- The resulting ".spl" file will be used for spell checking, it does not
|
||||||
|
@@ -8216,7 +8216,7 @@ local options = {
|
|||||||
|zg| and |zw| commands can be used to access each. This allows using
|
|zg| and |zw| commands can be used to access each. This allows using
|
||||||
a personal word list file and a project word list file.
|
a personal word list file and a project word list file.
|
||||||
When a word is added while this option is empty Nvim will use
|
When a word is added while this option is empty Nvim will use
|
||||||
(and auto-create) `stdpath('data')/spell/`. For the file name the
|
(and auto-create) `stdpath('data')/site/spell/`. For the file name the
|
||||||
first language name that appears in 'spelllang' is used, ignoring the
|
first language name that appears in 'spelllang' is used, ignoring the
|
||||||
region.
|
region.
|
||||||
The resulting ".spl" file will be used for spell checking, it does not
|
The resulting ".spl" file will be used for spell checking, it does not
|
||||||
|
@@ -5550,7 +5550,7 @@ void spell_add_word(char *word, int len, SpellAddType what, int idx, bool undo)
|
|||||||
// Initialize 'spellfile' for the current buffer.
|
// Initialize 'spellfile' for the current buffer.
|
||||||
//
|
//
|
||||||
// If the location does not exist, create it. Defaults to
|
// If the location does not exist, create it. Defaults to
|
||||||
// stdpath("data") + "/spell/{spelllang}.{encoding}.add".
|
// stdpath("data") + "/site/spell/{spelllang}.{encoding}.add".
|
||||||
static void init_spellfile(void)
|
static void init_spellfile(void)
|
||||||
{
|
{
|
||||||
char *lend;
|
char *lend;
|
||||||
@@ -5579,7 +5579,7 @@ static void init_spellfile(void)
|
|||||||
xstrlcpy(buf, xdg_path, buf_len);
|
xstrlcpy(buf, xdg_path, buf_len);
|
||||||
xfree(xdg_path);
|
xfree(xdg_path);
|
||||||
|
|
||||||
xstrlcat(buf, "/spell", buf_len);
|
xstrlcat(buf, "/site/spell", buf_len);
|
||||||
|
|
||||||
char *failed_dir;
|
char *failed_dir;
|
||||||
if (os_mkdir_recurse(buf, 0755, &failed_dir, NULL) != 0) {
|
if (os_mkdir_recurse(buf, 0755, &failed_dir, NULL) != 0) {
|
||||||
|
@@ -119,12 +119,12 @@ describe('spellfile', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe('default location', function()
|
describe('default location', function()
|
||||||
it("is stdpath('data')/spell/en.utf-8.add", function()
|
it("is stdpath('data')/site/spell/en.utf-8.add", function()
|
||||||
n.command('set spell')
|
n.command('set spell')
|
||||||
n.insert('abc')
|
n.insert('abc')
|
||||||
n.feed('zg')
|
n.feed('zg')
|
||||||
eq(
|
eq(
|
||||||
t.fix_slashes(fn.stdpath('data') .. '/spell/en.utf-8.add'),
|
t.fix_slashes(fn.stdpath('data') .. '/site/spell/en.utf-8.add'),
|
||||||
t.fix_slashes(api.nvim_get_option_value('spellfile', {}))
|
t.fix_slashes(api.nvim_get_option_value('spellfile', {}))
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user