From e2c41136f36e78f508ad4204cf67b1b36da253bc Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Tue, 12 Aug 2014 15:35:54 -0700 Subject: [PATCH] preventDefault -> cancel() --- src/editor.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor.coffee b/src/editor.coffee index e34ec739b..8083e0c70 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -629,8 +629,8 @@ class Editor extends Model # Public: For each selection, replace the selected text with the given text. # - # Emits: `will-insert-text -> ({text, preventDefault})` before the text has - # been inserted. Calling `preventDefault` will prevent the text from being + # Emits: `will-insert-text -> ({text, cancel})` before the text has + # been inserted. Calling `cancel` will prevent the text from being # inserted. # Emits: `did-insert-text -> ({text})` after the text has been inserted. # @@ -640,8 +640,8 @@ class Editor extends Model # Returns a {Bool} indicating whether or not the text was inserted. insertText: (text, options={}) -> willInsert = true - preventDefault = -> willInsert = false - @emit('will-insert-text', {preventDefault, text}) + cancel = -> willInsert = false + @emit('will-insert-text', {cancel, text}) if willInsert options.autoIndentNewline ?= @shouldAutoIndent()