【发布时间】:2021-01-06 20:57:54
【问题描述】:
在我的 Ace 编辑器中,就在滚动条出现之后,字符正在输入,但光标所在的位置却没有。见下图。出了什么问题?该代码在我的开发环境中似乎可以正常工作。
我注意到我的开发环境的字体比我的生产环境的字体大。
开发环境:
产品环境:
我不明白为什么会有差异,以及这是否是问题的原因。
将fonts显式设置为courier new后,编辑器选项为
editor options are {selectionStyle: "line", highlightActiveLine: true, highlightSelectedWord: true, readOnly: false, copyWithEmptySelection: false, …}animatedScroll: falseautoScrollEditorIntoView: undefinedbehavioursEnabled: truecopyWithEmptySelection: falsecursorStyle: "ace"displayIndentGuides: truedragDelay: 0dragEnabled: trueenableBlockSelect: trueenableMultiselect: truefadeFoldWidgets: falsefirstLineNumber: 1fixedWidthGutter: undefinedfocusTimeout: 0foldStyle: "markbegin"fontFamily: "Courier New"fontSize: "14pt"hScrollBarAlwaysVisible: falsehasCssTransforms: undefinedhighlightActiveLine: truehighlightGutterLine: truehighlightSelectedWord: trueindentedSoftWrap: truekeyboardHandler: undefinedmaxLines: undefinedmaxPixelHeight: 0mergeUndoDeltas: trueminLines: undefinedmode: "ace/mode/html"navigateWithinSoftTabs: falsenewLineMode: "auto"overwrite: falseplaceholder: undefinedprintMargin: 80printMarginColumn: 80readOnly: falserelativeLineNumbers: undefinedscrollPastEnd: 0scrollSpeed: 2selectionStyle: "line"showFoldWidgets: trueshowGutter: trueshowInvisibles: falseshowLineNumbers: trueshowPrintMargin: truetabSize: 4theme: "ace/theme/eclipse"tooltipFollowsMouse: trueuseSoftTabs: trueuseTextareaForIME: trueuseWorker: truevScrollBarAlwaysVisible: falsewrap: "off"wrapBehavioursEnabled: true__proto__: Object
更新
似乎编辑器中的每一行都有一个类ace_gutter-cell。此类与dev 和prod 环境不同。 prod 中缺少 position:absolute。请参阅下面的图片。我是否选择了 ace 的不同版本?
开发人员:
产品:
【问题讨论】:
标签: ace-editor