Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/115385

Change subject: Check indentation was successful before trying again
......................................................................

Check indentation was successful before trying again

If for some reason the indentation fails (although it really
shouldn't), we don't want to get stuck in an infinite loop.

Bug: 58060
Change-Id: Icf74c42a224d949e51727fd93a84c0b3bfa3e8d5
---
M modules/ve/ui/actions/ve.ui.ListAction.js
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/85/115385/1

diff --git a/modules/ve/ui/actions/ve.ui.ListAction.js 
b/modules/ve/ui/actions/ve.ui.ListAction.js
index 5db0b2e..ad683ea 100644
--- a/modules/ve/ui/actions/ve.ui.ListAction.js
+++ b/modules/ve/ui/actions/ve.ui.ListAction.js
@@ -134,11 +134,9 @@
 
        surfaceModel.breakpoint();
 
-       node = documentModel.getNodeFromOffset( 
surfaceModel.getSelection().start );
-       while ( node.hasMatchingAncestor( 'list' ) ) {
-               this.surface.execute( 'indentation', 'decrease' );
+       do {
                node = documentModel.getNodeFromOffset( 
surfaceModel.getSelection().start );
-       }
+       } while ( node.hasMatchingAncestor( 'list' ) && this.surface.execute( 
'indentation', 'decrease' ) );
 
        surfaceModel.breakpoint();
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/115385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf74c42a224d949e51727fd93a84c0b3bfa3e8d5
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to