修复一个自动完成模式和亚麻模式的烦恼 [英] fix an auto-complete-mode and linum-mode annoyance

查看:125
本文介绍了修复一个自动完成模式和亚麻模式的烦恼的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用自动完成模式我认为这是完全太棒了。我也亚麻模式的忠实粉丝,但我有一个很讨厌的问题,当两者一起使用,特别是当我在一个新的缓冲区正在处理(或极少数行的缓冲区)。

I'm using auto-complete-mode which I think is totally fantastic. I'm also a big fan of linum-mode but I've got a very irritating issue when the two are used together, especially when I'm working in a new buffer (or a buffer with very few lines).

基本上缓冲区'X'线长,但是当它自动完成踢,增加了行到缓冲区,因此亚麻模式不断切换,例如上一列或两列显示行数,取决于是否与自动完成是在暗示一个完成与否。

Basically the buffer is 'x' lines long but when auto-complete kicks in it "adds" lines to the buffer, so linum-mode keeps switching, for example, between displaying line numbers on one column or two columns, depending on whether auto-complete is suggesting a completion or not.

所以你键入一个句子,你看到你的缓冲区内容疯狂地从左至右移动在每一个关键的preSS。它的真正的烦了。

So you type a sentence and you see your buffer's content frantically shifting from left to right at every keypress. It is really annoying.

我把它的解决方案涉及配置的亚麻格式的变量,但我不知道怎么办。

I take it the solution involves configuring the linum-format variable but I don't know how.

在理想情况下这将是巨大的,如果我的亚麻格式为:

Ideally it would be great if my linum-format was:


  • 动态

  • 右对齐

  • 考虑到有'Y'多行到缓冲区比缓冲区实际上有

我的理由是说自动完成不得超过建议'y'的建议,并说,因此,二人开始很好地一起玩了。

My rationale being that auto-complete shall not suggest more than 'y' suggestion and that, hence, the two shall start playing nicely together.

例如,如果Y设置为20,我的缓冲区中有75行,那么亚麻应该使用两列:因为无论我在哪里自动完成不得缓冲区大比99行。

For example, if 'y' is set to 20 and my buffer has 75 lines, then linum should use two columns: because no matter where I am auto-complete shall not make the buffer 'bigger' than 99 lines.

相反,如果Y仍设置为20,我的缓冲区中有95行,则亚麻应使用三列,因为否则的话我靠近缓冲区的结束和自动完成在我的缓冲区将开始踢摆动左,右,当我键入

On the contrary, if 'y' is still set to 20 and my buffer has 95 lines, then linum should use three columns because otherwise if I'm near the end of the buffer and auto-complete kicks in my buffer shall start "wobbling" left and right when I type.

我宁愿不硬code宽3列亚麻

I'd rather not hardcode "3 columns wide" for linum.

我想我描述将是巨大的使用动态的,但总有至少两列会以某种方式解决最烦恼,但仍东西。

I guess using "dynamic but always at least two columns" would somehow fix most annoyances but still something as I described would be great.

PS:我知道我的'修复'将意味着亚麻会始终显示在至少两列,和我很好与......只要它保持右对齐,并使用2, 3或4列根据需要

推荐答案

简单地说在解决此问题的.emacs以下行。它是自动complete.el。

Simply put the following line in .emacs which resolves this issue. It is in auto-complete.el.

(ac-linum-workaround)

这篇关于修复一个自动完成模式和亚麻模式的烦恼的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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