mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
📝 Expose TextEditor::observeGrammar
This commit is contained in:
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user