Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore words inside backtick/backquote(`) #20

Closed
vcfvct opened this issue Oct 22, 2019 · 10 comments
Closed

Ignore words inside backtick/backquote(`) #20

vcfvct opened this issue Oct 22, 2019 · 10 comments

Comments

@vcfvct
Copy link

vcfvct commented Oct 22, 2019

Hey @kamykn Thanks for this nice plugin. Camel case support is great.

Is there a way to config the spelunker to ingore words inside the backticks? I believe this is the behavior of the vim's built-in spell check. I found this the time I enabled spelunker and disabled build-in checker, a lot misspells indicators came up inside backticks.

Thanks!

@kamykn
Copy link
Owner

kamykn commented Oct 29, 2019

Hi, @vcfvct !

Thank you for your feedback.
Maybe, this behavior is for markdown only, and the link syntax is similar as this behavior too.
It is difficult to add same behavior for Spelunker.vim, because it does not parse the texts.

However, I think it is a very good idea, so I would like to try it if there is a good way.

@leycec leycec mentioned this issue Apr 14, 2020
kamykn added a commit that referenced this issue Apr 16, 2020
@kamykn
Copy link
Owner

kamykn commented Apr 19, 2020

@vcfvct
I'm sorry that I made you wait.
I added new option for this Issue.

" Disable checking words in backtick/backquote.
let g:spelunker_disable_backquoted_checking = 1

Please update the plugin and try new option!

@vcfvct
Copy link
Author

vcfvct commented Apr 20, 2020

Great. Thanks a lot. 👍
I installed the latest version via vim plug, The checking is working. For some reason, the highlight does not work any more even though I could still navigate the mispelss with ZN or correct with ZL.
Any clue? Thanks.
FYI, I am using nvim-v0.4.3 with Alacritty + tmux on MacOS.

@kamykn
Copy link
Owner

kamykn commented Apr 20, 2020

I'm trying to find out this problem, but same problem does not occur with my nvim-v0.4.3 with Alacritty + tmux. Can you tell me your situation when the problem occurred.

  1. Please tell me your spelunker.vim settings.
  2. Does the problem occur with a specific words?

I need more information to replicate the same behavior you reported.

@kamykn
Copy link
Owner

kamykn commented Apr 20, 2020

I fix some bugs. Please update the plugin and make sure the problem is fixed 🙏

9bfe895
d0f892a

@vcfvct
Copy link
Author

vcfvct commented Apr 21, 2020

Thanks for the quick response.
After trying many combinations, looks like it is because of the colorscheme Plug 'morhetz/gruvbox' that I am using. If I revert to the default nvim color, the underscore and highlights shows up correctly.
Any solutions here? 😄

@kamykn
Copy link
Owner

kamykn commented Apr 21, 2020

Some color scheme plugin reset highlighting to default.
And morhetz/gruvbox is also reseting highlight too.

https://github.com/morhetz/gruvbox/blob/master/colors/gruvbox.vim#L12-L17

To fix it, you need to load spelunker.vim after loading gruvbox plugin.
Or add highlight setting after color scheme plugin loading.

" Override highlight setting.
highlight SpelunkerSpellBad cterm=underline ctermfg=247 gui=underline guifg=#9e9e9e
highlight SpelunkerComplexOrCompoundWord cterm=underline ctermfg=NONE gui=underline guifg=NONE

@vcfvct
Copy link
Author

vcfvct commented Apr 21, 2020

Awesome, that's the root cause. You the man! 👍
どうもありがとう!
One thing I notice is say if I type godo with back-tick which is a mispell and reload file, it skips the check correctly. However, if i type another godo in normal text, it will mark/highlight both as mispell.
Is that an expected behavior?

@kamykn
Copy link
Owner

kamykn commented Apr 27, 2020

@vcfvct
Now, spelunker.vim depends on matchadd() for highlighting. This function uses a regular expression to specify the target to highlight. If there are more options in the future, it is difficult to exclude ignore options such as backquotes.
Therefore, this is currently the expected behavior.

@vcfvct
Copy link
Author

vcfvct commented Apr 28, 2020

Got it. Thanks. :)
I am closing this for now!

@vcfvct vcfvct closed this as completed Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants