From f45c0236abb6dcc3a0b1efa0cf4656e059f4e7b7 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 23 Aug 2017 14:52:56 +0200 Subject: [PATCH] Enhance error when a line component is not found for a screen line Signed-off-by: Nathan Sobo --- src/text-editor-component.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index e36aa2aa2..2d904c401 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -2227,13 +2227,16 @@ class TextEditorComponent { const lineComponent = this.lineComponentsByScreenLineId.get(screenLine.id) if (!lineComponent) { - const error = new Error('Requested measurement of a line that is not currently rendered') + const error = new Error('Requested measurement of a line component that is not currently rendered') error.metadata = { row, columnsToMeasure, renderedScreenLineIds: this.renderedScreenLines.map((line) => line.id), extraRenderedScreenLineIds: Array.from(this.extraRenderedScreenLines.keys()), - lineNodeScreenLineIds: Array.from(this.lineNodesByScreenLineId.keys()) + lineComponentScreenLineIds: Array.from(this.lineComponentsByScreenLineId.keys()), + renderedStartRow: this.getRenderedStartRow(), + renderedEndRow: this.getRenderedEndRow(), + requestedScreenLineId: screenLine.id } throw error }