Thread: [cedet-semantic] Semantic causes scrolling while editing
Brought to you by:
zappo
From: Barry O. <gun...@gm...> - 2013-06-18 21:15:45
|
While I'm editing C++ or Java source code, I find that there is undesired scrolling, seemingly because of Semantic parsing new code. I started seeing this when I customized scroll-margin to 4 and scroll-conservatively to 101. I'll be in the middle of typing code (nowhere near the scroll margins), then I see point briefly flash to the function header and back to where I'm editing. While the point moved however, it caused an automatic scroll. I experimented with something like this in a command: (defun myfun () (interactive) (save-excursion (goto-char 43) (sleep-for 1))) and found that M-x myfun never causes an automatic scroll, no matter whether position 43 is outside view, in the scroll-margin, or in the middle of view. Also, during the 1 second I don't even see point at 43, like I do when I encounter this bug. Does Semantic ever move point outside of save-excursion and restore it another way? Could you indicate the Semantic functions invoked while one is writing code? Perhaps you could write code for a little with these scroll settings to see if you can reproduce it. |
From: Eric M. L. <er...@si...> - 2013-06-21 02:27:00
|
On 06/18/2013 05:15 PM, Barry OReilly wrote: > While I'm editing C++ or Java source code, I find that there is > undesired scrolling, seemingly because of Semantic parsing new code. I > started seeing this when I customized scroll-margin to 4 and > scroll-conservatively to 101. I'll be in the middle of typing code > (nowhere near the scroll margins), then I see point briefly flash to the > function header and back to where I'm editing. While the point moved > however, it caused an automatic scroll. > > I experimented with something like this in a command: > > (defun myfun () > (interactive) > (save-excursion (goto-char 43) (sleep-for 1))) > > and found that M-x myfun never causes an automatic scroll, no matter > whether position 43 is outside view, in the scroll-margin, or in the > middle of view. Also, during the 1 second I don't even see point at 43, > like I do when I encounter this bug. > > Does Semantic ever move point outside of save-excursion and restore it > another way? Could you indicate the Semantic functions invoked while one > is writing code? Perhaps you could write code for a little with these > scroll settings to see if you can reproduce it. Hi Barry, The place to start is in cedet/semantic/idle.el. The outward call to the various work functions purposely does not use 'save-excursion' so tools like completion can move things around for you. An easy trick is to use the Development menu to turn off all the various service modes (like parse in idle time) and see which one causes the scroll. Maybe tag summaries or tag completion is it. Good Luck Eric |