简体   繁体   English

Emacs 更改字体大小后的滚动行为

[英]Emacs scrolling behaviour after changing font size

Emacs23 GUI in Ubuntu 10.04 LTS. Ubuntu 10.04 LTS 中的 Emacs23 GUI。 I've previously not changed any settings relating to Emacs scrolling behaviour.我以前没有更改任何与 Emacs 滚动行为相关的设置。 However, today I noticed a peculiar jumping behaviour when scrolling down in a buffer -- the cursor down key would scroll down as normal to a point and then the next keypress down would sometimes scroll the buffer down instead or sometimes appear to scroll the buffer up and then move the selected line down.然而,今天我注意到在缓冲区中向下滚动时出现一种特殊的跳跃行为——cursor 向下键会像往常一样向下滚动到一个点,然后下一次按下键有时会向下滚动缓冲区,或者有时似乎向上滚动缓冲区然后向下移动选定的行。 It appeared to be more buggy behaviour rather than the normal or predictable jumping of the buffer.它似乎是更多的错误行为,而不是缓冲区的正常或可预测的跳跃。 If I held down the down cursor the screen would jump and scroll and stutter and then lurch forward and then stutter.如果我按住 cursor 向下键,屏幕会跳动、滚动、卡顿,然后向前倾斜,然后卡顿。

I searched for some answers and tried a few mentioned here, but nothing solved the problem.我搜索了一些答案并尝试了这里提到的一些,但没有解决问题。 Only then did I realize that this behaviour is new -- it only appeared after I changed the font in the buffer with Cx C-- .直到那时我才意识到这种行为是新的——它只在我用Cx C--更改缓冲区中的字体后才出现。 When I returned the font to the "default" with Cx C-+ , the scrolling behaviour returned to normal (the point moves to the last line, then the next press scrolls a few lines and moves the point up and displays the lines below; this is the default I think and I'm happy with it).当我使用Cx C-+将字体恢复为“默认”时,滚动行为恢复正常(点移动到最后一行,然后下一次按下滚动几行并将点向上移动并显示下面的行;这是我认为的默认设置,我对此感到满意)。 Ideas?想法?

Edit: Scrolling up works fine (as expected/default) regardless of font-size changes.编辑:无论字体大小更改如何,向上滚动都可以正常工作(如预期/默认)。 Changing the font smaller a second time only makes the scrolling more bizarre.再次将字体更改为更小只会使滚动更加奇怪。

Edit: Temporary workaround: return to using emacs -nw编辑:临时解决方法:返回使用emacs -nw

Update: Tested on another Ubuntu 10.04 machine (desktop).更新:在另一台 Ubuntu 10.04 机器(台式机)上测试。 Launched Emacs 23 and loaded a log file.启动 Emacs 23 并加载日志文件。 Maximized Emacs.最大化 Emacs。 Help down cursor and scrolling worked as normal -- the cursor gets to the bottom, the buffer scrolls and the cursor moves to the middle of the screen.帮助向下 cursor 和滚动工作正常 - cursor 到达底部,缓冲区滚动并且 cursor 移动到屏幕中间。 Cx C-- to reduce font size. Cx C--减小字体大小。 Scroll down again.再次向下滚动。 Same strange jerky behaviour, where some jumps don't seem to even move the buffer properly.同样奇怪的生涩行为,其中一些跳跃似乎甚至无法正确移动缓冲区。 Enlarge font once, and scrolling returns to normal.放大一次字体,滚动恢复正常。 Scrolling up is fine regardless of font size.无论字体大小如何,向上滚动都很好。 I searched the Emacs bug tracker briefly but did not find a bug which matched.我短暂搜索了 Emacs 错误跟踪器,但没有找到匹配的错误。

I've had this problem (or something very similar) for a long time.很长一段时间以来,我都遇到了这个问题(或非常相似的问题)。 I finally found something ( on EmacsWiki ) that's working:我终于找到了一些有用的东西(在 EmacsWiki 上):

(setq auto-window-vscroll nil)

Without this, the buffer will not scroll down correctly when I've altered the font size, regardless of my scroll settings, which are, for what it's worth,没有这个,当我更改字体大小时,缓冲区将无法正确向下滚动,而不管我的滚动设置如何,这是值得的,

(setq scroll-conservatively 10)
(setq scroll-margin 7)

Consider filing an Emacs bug: Mx report-emacs-bug .考虑提交 Emacs 错误: Mx report-emacs-bug

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM