在我的 Ace 编辑器中,滚动条出现后,字符被输入,但不是光标所在的位置。见下图。出了什么问题?该代码在我的开发环境中似乎工作正常。
我注意到我的开发环境的字体比我的产品环境的字体大。
Dev env:
产品环境:
我不明白为什么会有差异,以及这是否是问题的原因。
设置后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
Update
似乎编辑器中的每一行都有一个类ace_gutter-cell
。这个类不一样dev
and prod
环境。position:absolute
缺失于prod
。请参阅下面的图片。我是否选择了不同的版本ace
?
Dev:
Prod:
当您使用非等宽字体时,就会发生这种情况;你必须在 Ace 中使用等宽字体。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)