Sublime Forum

Pop-up spelling suggestions context menu black with spell checking in Sublime Text 3

#1

I have coded a keybinding to the the context menu to view spelling suggestions:

"command": "context_menu"

The way go to next spelling works is it goes to the end of the word. But if the cursor at the end of the word then it shows nothing for the spelling suggestions. If it is inside the word or at the beginning of the word it does work. Is there an easy way to say go back one character or to the beginning of the word? Or is there a spelling package that works for Sublime text 3 like this with keybindings instead of the mouse that I couldn’t find.

Also not a big deal but on a side note. Is it possible to get ctrl+n and ctrl+p working in the context menu to select. Assume for menus any keybindings are turned off.

0 Likes

#2

##Use:

Chain Of Command

 



 

More detailed response @ your

StackOverflow Question

 
( thanks @kingkeith for the tip :wink: )

1 Like

#3
1 Like

#4

Interestingly, the context menu does popup, but there is no suggestion word. It seems that the cursor needs to be on the word in order to get suggestion words?

0 Likes

#5

 
I just updated the SO answer with a fix.

I noticed a weird bug where the context menu suggestions would work for words within a sentence, but not if the word was directly followed by a newline character.

3 Likes

#6

Read the stack overflow or I ended up using this to put the cursor back in the proper position. If you don’t have sublemacs installed then the commented commands for move word should also work just had :

{
"keys": ["ctrl+alt+w"],
// Force ability to bring up context menu
"command": "chain",
"context": [ { "key": "selection_empty", "operator": "equal", "operand":     true } ],
"args": {
    "commands": [
        // ["move", {"by":"word", "forward": false, "extend": false}],
        ["sbp_move_word", {"direction": -1}],
        ["context_menu"],
        ["move", {"by":"wordends", "forward": true, "extend": false}],
] }
},

// Do not use "find_under_expand" if selection is made
{
"keys": ["ctrl+alt+w"],
"command": "chain",
"context": [ { "key": "selection_empty", "operator": "equal", "operand": false } ],
"args": { "commands": [
            ["sbp_move_word", {"direction": -1}],
    // ["move", {"by":"word", "forward": false, "extend": true}],
    ["context_menu"], 
    ["move", {"by":"wordends", "forward": true, "extend": true}],
] }
},`
1 Like

#8

Of note when the context menu comes up you can hit a or i to bring you right to add or ignore a word really quickly besides navigating with up arrow or down arrow or ctrl+n or ctrl+p to select a correct spelling. A crude way of getting a spellchecker just using the keyboard.

0 Likes

#9

Hey! I just try to build a toy about spell autocomplete here. It tries to do a simple fuzzy search in a dictionary. But I do not know the notion in the dictionary file and the search algorithm is just kind of simple so it works not that well.

I think I may not continue to play with it but I put it in public in case you guys interest.

1 Like