Sublime Forum

Trying to built spell check type plugin

#1

Hello Everyone,

I am trying to built one plugin that is similar to spell check. I want to check every word, if it is matches to particular word then it should show red line under that word. It should be done at run time. When user is writing something then after giving space, it should check whether it is matching to that particular word or not? . If it is matching then show red line under that word.

I think now you are very much clear what I am trying to built.

Is there any similar plugin available for this problem statement?

1 Like

#2

I see two possibilities:

  • You can just write a dictionary file and use the built-in spellcheck
  • You can write something similar to a linter, i.e. search for the words and add a underline to them (this will look a little bit different)
1 Like

#3

You can add the “squiggly” underline with add_regions through sublime.DRAW_SQUIGGLY_UNDERLINE, but you won’t be able to do it in red color all the time. Probably try with markup.error as the color scope.

1 Like

#4

Hii all ,

I am trying to highlight words that i have found in my loaded file . I am facing one problem . I have all regions of words that I want to highlight but I am not able to use add_regions() function.

selectedWordRegion = view.find_all(’[A-Z][a-zA-Z0-9]+’)

add_regions(key, [regions], scope, icon, flags)

Query :-
what is the key value and scope?

0 Likes

#5

did you read http://www.sublimetext.com/docs/3/api_reference.html#sublime.View?

1 Like

#6

Thanks . I was passing wrong values in add_regions function.

1 Like