Skip to content

Add :spellrare#4291

Closed
arp242 wants to merge 1 commit intovim:masterfrom
arp242:spellrare
Closed

Add :spellrare#4291
arp242 wants to merge 1 commit intovim:masterfrom
arp242:spellrare

Conversation

@arp242
Copy link
Contributor

@arp242 arp242 commented Apr 22, 2019

Add :spellrare as a compliment to :spellgood and :spellwrong.

I didn't add the normal mode commands, as zr and zR is already taken for
folding. I'm not sure which keys would make sense, if any? The only
letters that are still free are zp, zq, and zy. Another alternative
might be z?

@codecov-io
Copy link

codecov-io commented Apr 22, 2019

Codecov Report

Merging #4291 into master will decrease coverage by 1.47%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4291      +/-   ##
==========================================
- Coverage   81.41%   79.94%   -1.48%     
==========================================
  Files         115      108       -7     
  Lines      145384   141951    -3433     
==========================================
- Hits       118370   113486    -4884     
- Misses      27014    28465    +1451
Impacted Files Coverage Δ
src/normal.c 79.2% <100%> (-1.76%) ⬇️
src/spellfile.c 73.86% <100%> (+0.03%) ⬆️
src/beval.c 3.53% <0%> (-80.43%) ⬇️
src/ui.c 54.25% <0%> (-14.55%) ⬇️
src/term.c 69.1% <0%> (-10.08%) ⬇️
src/gui_gtk_x11.c 48.74% <0%> (-9.47%) ⬇️
src/gui_beval.c 55.02% <0%> (-8.35%) ⬇️
src/main.c 65.43% <0%> (-7.16%) ⬇️
src/gui.c 57.88% <0%> (-5.87%) ⬇️
src/menu.c 68.08% <0%> (-5.3%) ⬇️
... and 68 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5328cb8...d4fc1a4. Read the comment docs.

@brammool
Copy link
Contributor

This looks like a good idea. I think using z? would be OK. I don't think there is something else that this command would do. This is a todo note for using it to search in not-folded text, but that could perhaps better be done with a regexp item.
Please add a test. :spell. There is a test in test_normal.vim, but test_spell.vim is a better place.

@brammool brammool added the needs a test used for a pull request where a test should be added label Apr 23, 2019
@arp242
Copy link
Contributor Author

arp242 commented Apr 24, 2019

I just realized that adding an upper-cased variant for z? to add a rare word to the internal word list will be impossible. Are we okay with that?

I think that would be fine, but just checking.

@chrisbra
Copy link
Member

I just realized that adding an upper-cased variant for z? to add a rare word to the internal word list will be impossible. Are we okay with that?

Fine with me. If I want to have a word marked as rare, I would like to have it marked not only for the current session, but always.

@brammool
Copy link
Contributor

brammool commented Apr 24, 2019 via email

@vim-ml
Copy link

vim-ml commented Apr 24, 2019 via email

@arp242
Copy link
Contributor Author

arp242 commented Apr 24, 2019

zu is part of the zug/zuG/zuw/zuW chains. I don't think we can use that (that was also my first choice!)

I don't think zQ/ZQ typos are that likely? At least, not how I type it. Perhaps it is different for others. More importantly, zq doesn't strike me as very mnemonic, whereas z? kind-of is. I think z/ makes more sense (or rather, it's the option that sucks the least).

@chdiza
Copy link

chdiza commented Apr 24, 2019

:spellrare seems niche enough that it doesn't even need normal-mode commands. A user who would use :spellrare a lot can define mappings to ape zg etc.

@arp242
Copy link
Contributor Author

arp242 commented Apr 24, 2019

Yeah, that's definitely an option as far as I'm concerned, and also the reason I didn't add any normal mode commands in the initial patch. I can add some docs on how to map it in the :spellrare docs for convenience.

@arp242
Copy link
Contributor Author

arp242 commented Apr 29, 2019

I updated the PR to mention normal mode mappings in the docs, and I added a few tests. I put them in vim_spellfile.vim. That seemed to make sense to me, since it's testing spellfile.c. I can put it in vim_spell.vim too, if people prefer.

@bdesham
Copy link

bdesham commented Jul 21, 2019

@brammool If this PR were to be updated to merge cleanly, would you be willing to merge it? I’m happy to do the work as long as it wouldn’t be a wasted effort :-)

@brammool
Copy link
Contributor

brammool commented Jul 22, 2019 via email

@arp242
Copy link
Contributor Author

arp242 commented Jul 27, 2019

I updated the patch; should apply cleanly to latest master now; tested again, and seems all good.

Add :spellrare as a compliment to :spellgood and :spellwrong.

I didn't add the normal mode commands, as zr and zR is already taken for
folding, so I added docs to mention normal mode mappings.
@arp242
Copy link
Contributor Author

arp242 commented Aug 9, 2019

Should be good to merge @brammool @chrisbra ?

@brammool brammool closed this in 08cc374 Aug 11, 2019
manuelschiller pushed a commit to manuelschiller/vim that referenced this pull request Nov 10, 2019
Problem:    There is :spellwrong and :spellgood but not :spellrare.
Solution:   Add :spellrare. (Martin Tournoij, closes vim#4291)
janlazo added a commit to janlazo/neovim that referenced this pull request Jun 12, 2021
…lrare

Problem:    There is :spellwrong and :spellgood but not :spellrare.
Solution:   Add :spellrare. (Martin Tournoij, closes vim/vim#4291)
vim/vim@08cc374
janlazo added a commit to janlazo/neovim that referenced this pull request Jun 12, 2021
…lrare

Problem:    There is :spellwrong and :spellgood but not :spellrare.
Solution:   Add :spellrare. (Martin Tournoij, closes vim/vim#4291)
vim/vim@08cc374
janlazo added a commit to janlazo/neovim that referenced this pull request Jun 12, 2021
…lrare

Problem:    There is :spellwrong and :spellgood but not :spellrare.
Solution:   Add :spellrare. (Martin Tournoij, closes vim/vim#4291)
vim/vim@08cc374
kraftwerk28 pushed a commit to kraftwerk28/neovim that referenced this pull request Jun 25, 2021
…lrare

Problem:    There is :spellwrong and :spellgood but not :spellrare.
Solution:   Add :spellrare. (Martin Tournoij, closes vim/vim#4291)
vim/vim@08cc374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs a test used for a pull request where a test should be added

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants