From 2710eade97a01cac1b3c950d7ac64f9844ec322e Mon Sep 17 00:00:00 2001 From: MusikAnimal Date: Mon, 18 Nov 2024 23:09:12 -0500 Subject: [PATCH] ve.ui.CodeMirrorAction.v6: Use direction of surface view, not model view This fixes an issue where the VE document model is incorrectly used in computing gutter width based on directionality. It should instead be the VE surface view's direction, in the event the user the is editing in RTL on a LTR document. See T374196#10311711. Bug: T374196 Follow-Up: I81e863e19d6d0bad2cc2be743df896e17a8dc548 Change-Id: Ic37d1004e9606dc2d29d98d29f28743202dd5683 --- resources/ve-cm/ve.ui.CodeMirrorAction.v6.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/ve-cm/ve.ui.CodeMirrorAction.v6.js b/resources/ve-cm/ve.ui.CodeMirrorAction.v6.js index d8d86a69..9258a3c3 100644 --- a/resources/ve-cm/ve.ui.CodeMirrorAction.v6.js +++ b/resources/ve-cm/ve.ui.CodeMirrorAction.v6.js @@ -101,7 +101,7 @@ ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) { } ); // Account for the gutter width in the margin. - action.updateGutterWidth( doc.getDir() ); + action.updateGutterWidth( surfaceView.getDocument().getDir() ); // Set focus on the surface view. surfaceView.focus();