Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 35695c4

Browse files
authored
Merge pull request #295 from atom/deprecate-skip-undo-option
Clarify deprecation of `undo: skip` option
2 parents b37be58 + 0477367 commit 35695c4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/text-buffer.coffee

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,8 @@ class TextBuffer
810810
setTextInRange: (range, newText, options) ->
811811
if options?
812812
{normalizeLineEndings, undo} = options
813+
Grim.deprecate('The `undo` option is deprecated. Call groupLastChanges() on the TextBuffer afterward instead.') if undo?
814+
813815
normalizeLineEndings ?= true
814816

815817
if @transactCallDepth is 0
@@ -843,7 +845,9 @@ class TextBuffer
843845
# * `text` A {String} representing the text to insert.
844846
# * `options` (optional) {Object}
845847
# * `normalizeLineEndings` (optional) {Boolean} (default: true)
846-
# * `undo` (optional) {String} 'skip' will skip the undo system
848+
# * `undo` (optional) *Deprecated* {String} 'skip' will skip the undo
849+
# system. This property is deprecated. Call groupLastChanges() on the
850+
# {TextBuffer} afterward instead.
847851
#
848852
# Returns the {Range} of the inserted text.
849853
insert: (position, text, options) ->
@@ -854,7 +858,9 @@ class TextBuffer
854858
# * `text` A {String} representing the text text to append.
855859
# * `options` (optional) {Object}
856860
# * `normalizeLineEndings` (optional) {Boolean} (default: true)
857-
# * `undo` (optional) {String} 'skip' will skip the undo system
861+
# * `undo` (optional) *Deprecated* {String} 'skip' will skip the undo
862+
# system. This property is deprecated. Call groupLastChanges() on the
863+
# {TextBuffer} afterward instead.
858864
#
859865
# Returns the {Range} of the inserted text
860866
append: (text, options) ->

0 commit comments

Comments
 (0)