Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlighter does not jump to to the proper found result when performing search in Ace editor

I am using ui-ace to display and edit a large xml file. The problem is when I perform searching (using Ctrl-F on ace editor), the page did not jump to the matched text if the text is out of the screen. I need to scroll it down to see that the text has been found and highlighted. The screen simply does not move when the text is not visible in the editor. How can I fix that so that the editor will jump to the matching text similar as the Ctrl-F of Chrome browser does?

I dont have this problem if I set the minLine and maxLine to a small value.

This is my example codes http://plnkr.co/edit/ohc3lB?p=preview.

<div ui-ace="{
      useWrapMode : true,
      showGutter: true,
      theme:'dawn',
      mode: 'xml',
      firstLineNumber: 5,
      onLoad: aceLoaded,
      onChange: aceChanged
    }" ng-controller='MainCtrl'>
    ......
</div>

Thanks

like image 911
Steven Avatar asked Dec 30 '25 06:12

Steven


1 Answers

When ace is inside another scrollable view use autoScrollEditorIntoView option, see https://github.com/ajaxorg/ace/blob/v1.2.3/demo/autoresize.html#L52

like image 164
a user Avatar answered Jan 01 '26 21:01

a user