Predelnik / DSpellCheck

Notepad++ Spell-checking Plug-in
GNU General Public License v2.0
198 stars 33 forks source link

FR: Ignore words that are all caps and are less than x characters in length #248

Closed Gitoffthelawn closed 2 years ago

Gitoffthelawn commented 3 years ago

Looking at my custom dictionary, I have over 3000 entries that are for for words that are less than 5 characters and are all caps.

Currently, you can ignore words in all caps, but I found that it too broad. It would be wonderful to have an option to specify "ignore words that are all caps and less than x characters in length".

Predelnik commented 3 years ago

There is hidden option Word_Minimum_Length for ignoring words with less length than X, it has to be directly written to ini file currently but it obviously doesn't look at letter case. "Ignoring all capital" option was added mostly for cases when such words are abbreviations and not uppercase due to style choice. Personally I also think this request is too specific as is #247 so along with it could be solved with supporting ignore via regular expression hopefully.

Predelnik commented 3 years ago

As with #247 I hope it is solved via ignore by regexp in 1.4.21. As an example for ignoring words with 5 or less capital letters: image

Gitoffthelawn commented 3 years ago

Thank you. Works well for me, overall.

I haven't had time to fully test it yet, but I think I did find two bugs:

If you enter an invalid regex, the input field will not turn red right away, and will accept the invalid input. That's bug 1. But then when you re-open the dialog box, the input will now have a red background.

Once you edit part of the invalid regex to be valid, it will still not work. That's bug 2.

To get the regex to work, you need to delete all of the invalid regex (not just edit it), and then enter a valid regex.

Despite these bugs, the functionality works well (thank you!) and is surprisingly fast. I was concerned about a long delay in large (2-6MB) text files, but at least so far, I haven't experienced any speed issues resulting from the spellcheck functionality.

Gitoffthelawn commented 3 years ago

BTW, in the screenshot in your example in this issue report, the "pipe-looking" symbol after the { is just the caret and not a pipe, correct?

Predelnik commented 3 years ago

It turns red when pressing apply, settings are not updated when not pressing apply, I don't know if it's intuitive enough or not. I think rechecking it on each change would make it flicker too much which is not good.

Gitoffthelawn commented 3 years ago

Ah, I see what you are doing. At a minimum, could it also check when the dialog box is opened?

I agree that flickering would be annoying.

Predelnik commented 3 years ago

At a minimum, could it also check when the dialog box is opened?

Can't say that I understand what you mean exactly unfortunately. I have tried pressing ok with wrong regexp and it becomes red when I open it next time. The same goes if I restart N++. Maybe pressing ok with incorrect regex could give some sort of warning immediately but other than that it seems to work as I planned.

Predelnik commented 2 years ago

I think this is solved with ignore via regexp