Problem with zG and spelloptions=camel

17 views
Skip to first unread message

Gary Johnson

unread,
Oct 17, 2022, 2:40:30 PM10/17/22
to vim...@googlegroups.com
I was trying to add a word to the internal word list with zG. The
status line indicated that the word was added, but it remained
highlighted as a bad word.

Steps to reproduce

1. $ cd ~/src/vim/vim # where latest clean build of Vim resides.
2. $ VIMRUNTIME=runtime vim -N -u NONE -i NONE -c 'set spell'
3. $ set spelloptions=camel
4. Add a line with these words:
Hello AB1234YZ world.
5. Note that "AB1234YZ" is highlighted as a bad word.
6. Move the cursor to 'A'.
7. Type
zG
8. Note that a message like the following is displayed in the
command/status line.
Word 'AB1234' added to /tmp/v9NFArp/0
9. Note also that that word remains highlighted as a bad word.
10. Move the cursor to the 'Y'.
11. Type
zG
12. Note that a message like the following is displayed in the
command/status line.
Word 'YZ' added to /tmp/v9NFArp/0
13. Note also that 'YZ' is no longer highlighted as a bad word but
'AB1234' still is.

Expected behavior

I expect 'AB1234' to not be highlighted as a bad word.

'AB1234' is not highlighted as bad word if it appears in the text
alone, but is highlighted when a some other word is appended, even
a properly-spelled, capitalized word.

Version of Vim

9.0.783

Environment

Operating system: Ubuntu 20.04
Terminal: Xterm(370)
Value of $TERM: xterm-256color
Shell: bash

Additional Context

I don't know that this has ever worked. I didn't try earlier
versions with the 'spelloptions' option. I just tried zG on
a similar string--a processor part number--for the first time
today.

Regards,
Gary

Bram Moolenaar

unread,
Oct 18, 2022, 7:51:28 AM10/18/22
to vim...@googlegroups.com, Gary Johnson
Seems like a specific case. If you make 'spelloptions' empty, use "zG"
and then set 'spelloptions' to "camel" again it works OK. Looks like
"zG" and the camel-split don't agree on what is a word.

--
"Software is like sex... it's better when it's free."
-- Linus Torvalds, initiator of the free Linux OS
Makes me wonder what FSF stands for...?

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages