From cc611f4254b4f1b48cbf29d12f5aaf38bd39f2b5 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 26 Feb 2018 11:47:43 +0000 Subject: [PATCH] TextSelection: Make chainable methods chainable Bug: T188119 Change-Id: I40030e1cbd3bc77a0db424d38cd61815deac2e12 --- resources/ext.CodeMirror.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js index 9b128a7c..64b35ede 100644 --- a/resources/ext.CodeMirror.js +++ b/resources/ext.CodeMirror.js @@ -60,6 +60,7 @@ }, setContents: function ( content ) { codeMirror.doc.setValue( content ); + return this; }, getSelection: function () { return codeMirror.doc.getSelection(); @@ -67,9 +68,11 @@ setSelection: function ( options ) { codeMirror.doc.setSelection( codeMirror.doc.posFromIndex( options.start ), codeMirror.doc.posFromIndex( options.end ) ); codeMirror.focus(); + return this; }, replaceSelection: function ( value ) { codeMirror.doc.replaceSelection( value ); + return this; }, getCaretPosition: function ( options ) { var caretPos = codeMirror.doc.indexFromPos( codeMirror.doc.getCursor( true ) ), @@ -81,6 +84,7 @@ }, scrollToCaretPosition: function () { codeMirror.scrollIntoView( null ); + return this; } };