gpt4 book ai didi

ace-editor - 为 ace 编辑器设置值,而不选择整个编辑器

转载 作者:行者123 更新时间:2023-12-03 05:08:01 25 4
gpt4 key购买 nike

因此,您可以使用 setValue 设置 ace 编辑器的值,但设置值后,编辑器将选择编辑器的整个值。如何禁用此功能?这意味着当我将 ace editor 的值设置为 Hello world 时,它不会突出显示 Hello world

最佳答案

可以在setValue之后使用第二个参数来控制光标位置

editor.setValue(str, -1) // moves cursor to the start
editor.setValue(str, 1) // moves cursor to the end

关于ace-editor - 为 ace 编辑器设置值,而不选择整个编辑器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18614169/

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