gpt4 book ai didi

javascript - 防止 ace 编辑器在光标上居中滚动?

转载 作者:行者123 更新时间:2023-11-29 19:28:03 26 4
gpt4 key购买 nike

即使光标不在屏幕之外,ace 编辑器也会将 View (水平滚动)置于光标的中心。

这发生在调整 ace 编辑器容器的大小之后。

如何防止ace编辑器在不需要时将光标居中?

最佳答案

This example说明问题。

要使用新宽度更新 ace 编辑器,请使用 editor.resize():

$(window).mouseup ()->
if dragging
editor.resize()
dragging = false
return

关于javascript - 防止 ace 编辑器在光标上居中滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29795040/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com