Catrope has uploaded a new change for review. Change subject: Fix exception when deleting all text (Ctrl+A Backspace) ......................................................................
Fix exception when deleting all text (Ctrl+A Backspace) Exception was caused by passing -1 to getAnnotationsFromOffset(). So check for -1 before passing it in; getNearestContentOffset() can legitimately return -1 if there are no content offsets in the document, which occurs when the document is empty. I was originally going to change getNearestContentOffset(start - 1, -1) to getRelativeContentOffset(start, -1), but Inez correctly pointed out that that would have unwanted results when near an inline node. Change-Id: Ife4b497b1c5fd04d411bb25cea99e6ea2abf146f --- M modules/ve/dm/ve.dm.Surface.js 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/62/28162/1 -- To view, visit https://gerrit.wikimedia.org/r/28162 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife4b497b1c5fd04d411bb25cea99e6ea2abf146f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Catrope <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
