Reputation: 445
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
Upvotes: 3
Views: 346
Reputation: 24104
When ace is inside another scrollable view use autoScrollEditorIntoView option, see https://github.com/ajaxorg/ace/blob/v1.2.3/demo/autoresize.html#L52
Upvotes: 1