Skip to content

Commit

Permalink
change snippet insertion to be a compound edit
Browse files Browse the repository at this point in the history
  • Loading branch information
GarstgerUnhold committed Oct 6, 2010
1 parent 2810ce0 commit a052aa3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions plugins/snippets/lib/snippets/tab_handler.rb
Expand Up @@ -23,12 +23,15 @@ def self.handle(edit_view, modifiers)
find_snippet(edit_view)
end
end


def self.activate_snippet(edit_view, snippet)
controller = edit_view.document.controllers(Snippets::DocumentController).first
doc = edit_view.document
doc.delete(doc.cursor_offset - snippet.tab_trigger.length, snippet.tab_trigger.length)
controller.start_snippet!(snippet)
edit_view.compound do
doc.delete(doc.cursor_offset - snippet.tab_trigger.length, snippet.tab_trigger.length)
controller.start_snippet!(snippet)
end
end

# Decides whether a snippet can be inserted at this location. If so
Expand Down
2 changes: 1 addition & 1 deletion vendor/java-mateview
Submodule java-mateview updated 1 files
+12 −11 src/com/redcareditor/mate/MateText.java

0 comments on commit a052aa3

Please sign in to comment.