Skip to content
Browse files

Merge branch 'spell_check_gem_test' of https://github.com/alkrauss48/…

…rb-gtk_app into alkrauss48-spell_check_gem_test
  • Loading branch information...
2 parents 6e09ac9 + a329034 commit 888528f8b49067fbc8d403287162db555813aeb0 @drfeelngood committed Apr 6, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 lib/gtk_app/text_buffer.rb
View
13 lib/gtk_app/text_buffer.rb
@@ -75,7 +75,10 @@ def check_spelling(word=nil, s_iter=nil, e_iter=nil)
text.gsub(/[\w\']+/) do |w| check_spelling(w); end
elsif !@spell_check.check(word)
s, e = start_iter.forward_search(word, Gtk::TextIter::SEARCH_TEXT_ONLY, nil)
- format(:spell_error, s, e)
+ format(:spell_error,s,e)
+ else
+ s, e = start_iter.forward_search(word, Gtk::TextIter::SEARCH_TEXT_ONLY, nil)
+ unformat(:spell_error, s, e)
end
end
@@ -126,7 +129,11 @@ def format_selection(tag_name)
def format(tag_name, s_iter, e_iter)
apply_tag(tag_name.to_s, s_iter, e_iter)
end
-
+
+ def unformat(tag_name, s_iter, e_iter)
+ remove_tag(tag_name.to_s, s_iter, e_iter)
+ end
+
# Remove all occurrences of a
# Gtk::TextTag[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ATextTag]
# in the given selection range.
@@ -207,4 +214,4 @@ def user_action?
end
end
-end
+end

0 comments on commit 888528f

Please sign in to comment.
Something went wrong with that request. Please try again.