-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Built in support for spell check suggestions #11
Comments
👍 Interested in doing a pull request? Should try to require |
Yup, currently working on splicing it in with prepend. Will see about a more integrated PR once I've got that working. There's a bit of inter process fiddling required I think. |
I fetched up ripping out what I needed and removing this dependency in the end. The spelling suggestions integration is done with an A few other things to note that I added, in case you fancy extending this package in future with any of them, or if others are interested (not all possible with the current append/prepend hooks)
|
Cool. Thanks for the ideas. Some of that does make sense. To make this module more easily extendable I'm thinking of a system where you can mix custom items with the provided ones: require('electron-context-menu')({
menu: x => [
x.COPY,
{
title: 'foo'
},
x.INSPECT
]
}); Where Continued in #14 Regardless of you using it, what do you think about it? |
Yeah that would be handy. If I could reuse your cut/copy/paste symbols and build the whole menu myself, while still using your separator filtering that'd be better. Just having more exports for the different stages would be a good start. |
There's no easy way to integrate https://github.com/electron-userland/electron-spellchecker with this module. |
@djalmaaraujo It is possible, it's just that Relevant issue: electron-userland/electron-spellchecker#80 |
@sindresorhus The docs are very bad indeed. This method you mentioned would check if a word is misspelled, but return the suggestions to this the context-menu, is a different thing. It's not related to this issue anyway. tks |
@sindresorhus I figured out by using one context menu for all the things (this module) and the other just for spellcheck: In the shouldShowMenu: (event, params) => !params.misspelledWord, And on the let contextMenuListener = new ContextMenuListener((info) => {
if (!info.misspelledWord) return;
contextMenuBuilder.showPopupMenu(info);
}); Doing this one can exclude the other in the correct context. |
@sindresorhus With my answer above, I think you can call "built-in support" something that is true. :). I would close this issue. |
@djalmaaraujo That's not a proper solution though. I plan on having spell-checking integrated into this context menu. |
@djalmaaraujo Were you actually able to use both electron-context-menu and electron-spellchecker together and display the correct context menu using the solution you mentioned? I tried that and I am not able to. When I right click on the misspelled word then first I get the application context menu and then I have to click again to get the spell checker context menu. Any help or pointers? |
@snene I used both, if I click on the text, I get the suggestions and IGNORE the next context-menu, so I don't end up having 2. shouldShowMenu: (event, params) => !params.misspelledWord, This will prevent |
Thanks @djalmaaraujo ! It worked for me too. It's a great workaround. I just needed to get the latest version of electron-context-menu. Thanks again! |
@IssueHunt has funded $100.00 to this issue.
|
So the original plan stands, detect if spell checker is loaded, and then show one or other? |
This should be easier to implement in Electron 8. There's now a Here's how it should look: See: https://www.electronjs.org/blog/electron-8-0#highlight-features |
Watching this issue |
@sindresorhus has rewarded $90.00 to @nautatva. See it on IssueHunt
|
Would make this a more attractive replacement for https://github.com/mixmaxhq/electron-editor-context-menu and should be simple enough to add.
e.g. https://github.com/mixmaxhq/electron-editor-context-menu/blob/d1703f7b7e4523af8c9c088d4a1efc06e2dc3b12/src/index.js#L93
IssueHunt Summary
nautatva has been rewarded.
Backers (Total: $100.00)
Submitted pull Requests
Tips
IssueHunt has been backed by the following sponsors. Become a sponsor
The text was updated successfully, but these errors were encountered: