王牌编辑光标行为不当 [英] ace editor cursor behaves incorrectly

查看:217
本文介绍了王牌编辑光标行为不当的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用王牌编辑器在我的项目。

i am using Ace editor in my project.

CSS:

#editor
{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
background-color:white;
}

JavaScript的:

javascript :

var editor = ace.edit("editor");
editor.setTheme("ace/theme/textmate");
editor.getSession().setMode("ace/mode/java");

#editor被包含在一个相对定位的div。

#editor is contained in a relatively positioned div.

问题:
这很难解释,但我会尽力。

problem : It's hard to explain but I'll try.

当过我的ACE类型文本行大小增加了空间光标的实际位置与它的预期位置增加。

when ever i type text in Ace as the line size increases the spaces in the cursor's actual position and it's expected position increases.

当我输入例如这是文字它表明这样的:

for e.g when i type "This is text" it shows like :

This is text           |

现在,当我preSS Backspace键将删除行T最后一个字符,并显示:

now when i press backspace key it will delete last character on line 't', and will show :

This is tex           |

我有搜索关于谷歌这个问题找到了Chrome浏览器种相似的问题时,变焦设置为120。
但我工作的Firefox浏览器。

i have searched about this issue on Google found one similar issue for chrome browser when zoom is set to 120. but I'm working on Firefox browser.

感谢。

推荐答案

王牌只能显示等宽字体,您所描述的问题可能发生或者如果有什么改变了编辑器非等宽的字体,或不同的字体的不同部分分配编辑。

Ace can display only monospace fonts, The issue you describe can happen either if something changes font of the editor to non monospace, or assigns different fonts to different parts of the editor.

(有在Ubuntu至极一个Firefox插件正在改变所有的字体到非等宽)

(There was a firefox addon on ubuntu wich was changing all fonts to non monospace)

这篇关于王牌编辑光标行为不当的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆