diff options
author | LemonBoy <thatlemon@gmail.com> | 2023-08-27 21:52:27 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-27 21:52:27 +0200 |
commit | d08745040bb82c5e9a81b6c8a414e50951642492 (patch) | |
tree | c00c0753b754d3b514f84f16ddf53fa14826148f /src/testdir/test_spell.vim | |
parent | 6c93c949298c1a6cb294a09b10d690cae357a8bf (diff) |
patch 9.0.1810: camel-case spelling has issues with digitsv9.0.1810
Problem: camel-case spelling has issues with digits
Solution: Improve the camCase spell checking by taking digits
and caps into account
Rewrite the conditions to check for word boundaries by taking into
account the presence of digits and all-caps sequences such as acronyms.
closes: #12644
closes: #12933
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Diffstat (limited to 'src/testdir/test_spell.vim')
-rw-r--r-- | src/testdir/test_spell.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim index 9eecb1e3f5..be0bc55810 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -132,6 +132,26 @@ foobar/? set spell& endfunc +func Test_spell_camelcase() + set spell spelloptions=camel + let words = [ + \ 'UPPER', + \ 'lower', + \ 'mixedCase', + \ 'HTML', + \ 'XMLHttpRequest', + \ 'foo123bar', + \ '12345678', + \ 'HELLO123world', + \] + + for word in words + call assert_equal(['', ''], spellbadword(word)) + endfor + + set spell& spelloptions& +endfunc + func Test_spell_file_missing() let s:spell_file_missing = 0 augroup TestSpellFileMissing |