Mercurial > vim
comparison src/testdir/test_spell.vim @ 33039:21f2838a4dd9 v9.0.1810
patch 9.0.1810: camel-case spelling has issues with digits
Commit: https://github.com/vim/vim/commit/d08745040bb82c5e9a81b6c8a414e50951642492
Author: LemonBoy <thatlemon@gmail.com>
Date: Sun Aug 27 21:52:27 2023 +0200
patch 9.0.1810: camel-case spelling has issues with digits
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 27 Aug 2023 22:00:06 +0200 |
parents | 7328cddca686 |
children | 15593f77c5c2 |
comparison
equal
deleted
inserted
replaced
33038:3b797830f9fd | 33039:21f2838a4dd9 |
---|---|
128 | 128 |
129 call delete('Xwords.spl') | 129 call delete('Xwords.spl') |
130 call delete('Xwords') | 130 call delete('Xwords') |
131 set spelllang& | 131 set spelllang& |
132 set spell& | 132 set spell& |
133 endfunc | |
134 | |
135 func Test_spell_camelcase() | |
136 set spell spelloptions=camel | |
137 let words = [ | |
138 \ 'UPPER', | |
139 \ 'lower', | |
140 \ 'mixedCase', | |
141 \ 'HTML', | |
142 \ 'XMLHttpRequest', | |
143 \ 'foo123bar', | |
144 \ '12345678', | |
145 \ 'HELLO123world', | |
146 \] | |
147 | |
148 for word in words | |
149 call assert_equal(['', ''], spellbadword(word)) | |
150 endfor | |
151 | |
152 set spell& spelloptions& | |
133 endfunc | 153 endfunc |
134 | 154 |
135 func Test_spell_file_missing() | 155 func Test_spell_file_missing() |
136 let s:spell_file_missing = 0 | 156 let s:spell_file_missing = 0 |
137 augroup TestSpellFileMissing | 157 augroup TestSpellFileMissing |