From b5b659a0508801741e8836aa69859616600d34ef Mon Sep 17 00:00:00 2001 From: k-utsumi Date: Thu, 25 Oct 2018 18:30:03 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20#93=20Issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reference source https://github.com/abe33/atom-tablr/issues/93#issuecomment-347242628 --- lib/table-element.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/table-element.js b/lib/table-element.js index 81b9bee..d21503a 100644 --- a/lib/table-element.js +++ b/lib/table-element.js @@ -1306,8 +1306,10 @@ class TableElement extends HTMLElement { const cursorValue = cursor.getValue() this.editor.setText(String(cursorValue || this.getUndefinedDisplay())) - this.editor.getBuffer().history.clearUndoStack() - this.editor.getBuffer().history.clearRedoStack() + if (this.editor.getBuffer().history != undefined) { + this.editor.getBuffer().history.clearUndoStack() + this.editor.getBuffer().history.clearRedoStack() + } if (initialData) { this.editor.setText(initialData) } } @@ -1353,8 +1355,10 @@ class TableElement extends HTMLElement { this.editorElement.focus() this.editor.setText(this.columnUnderEdit.name != null ? this.columnUnderEdit.name : columnName(columnIndex)) - this.editor.getBuffer().history.clearUndoStack() - this.editor.getBuffer().history.clearRedoStack() + if (this.editor.getBuffer().history != undefined) { + this.editor.getBuffer().history.clearUndoStack() + this.editor.getBuffer().history.clearRedoStack() + } } }