From a28fed8bae5e29f281a12b89cba7d194bf5f08b9 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Tue, 7 Oct 2014 18:06:00 -0700 Subject: [PATCH] :memo: Expose TextEditor::observeGrammar --- src/text-editor.coffee | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index abed65842..000359077 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -260,14 +260,23 @@ class TextEditor extends Model onDidChangeSoftWrapped: (callback) -> @displayBuffer.onDidChangeSoftWrapped(callback) + # Extended: Calls your `callback` when the grammar that interprets and + # colorizes the text has been changed. Immediately calls your callback with + # the current grammar. + # + # * `callback` {Function} + # * `grammar` {Grammar} + # + # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. observeGrammar: (callback) -> callback(@getGrammar()) @onDidChangeGrammar(callback) - # Extended: Calls your `callback` when the grammar that interprets and colorizes the text has - # been changed. + # Extended: Calls your `callback` when the grammar that interprets and + # colorizes the text has been changed. # # * `callback` {Function} + # * `grammar` {Grammar} # # Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. onDidChangeGrammar: (callback) ->