jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: Icf74c42a224d949e51727fd93a84c0b3bfa3e8d5
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to