Closed vi closed 8 years ago
I can't reproduce this problems. main.c is highlighted fine for me, and file is not scrolled automatically. Could you make a video and a screenshot?
http://vi-server.org/pub/enki_issue_396.mkv
Shows both bugs. Looks like the one with scrolling is also reproducible on other opened files (on testdemod.c
it jumps down instead of up).
Now I see the bugs but still can not reproduce.
Which Qt version do you have?
Are you sure you are using the latest Enki master and Qutepart master?
Could you post minimal text file where struct
is not highlighted with bold?
libqt5gui5 is 5.3.2+dfsg-4+deb8u1 qutepart is dcccf5b5b42cc17e6995f7687d194c7b7646ddcb enki is 13092303409e6b2560cd2be247b580af2e7cb51f
Copying mod.c
to qwerty.c
and opening it in the same Enki instance using Locator's ./qwerty.c
reveals correctly working file (with Navigator and with correct highlight, although still incorrect scrolling)
Maybe the problem was in detection of syntax highlight mode when mod.c
was opened for the first time (when it was still little). How do I explicitly display current syntax mode?
Update Qutepart, do ./editor -l mod.c
For current version of the file it prints Language: C
. I didn't saved early enough version file although.
I suspect that if I close and reopen the file in that Enki instance, it will become allright. Shall I try this or shall I keep it in the wrong state for a change to gather some data?
There are no data to capture. And I don't have an idea why the file was recognized incorrectly. Was there some special header. I.e. python shebang in the first line?
No. Maybe it was empty, maybe there was some #include
or #if
.
How do I dump syntax language from currently running Enki?
No way
The annoyance continues (unrelated to syntax, now it's in Rust file). Now it doesn't always happen, but happens sporadically: sometimes viewport position jumps on scroll after clicking, sometimes after searching.
Shall I consider temporarily downgrading to pre-Py3-Qt5 version?
Is the Preview window open with CodeChat enabled?
What is CodeChat?
It's just Opened Files pane on the left and editor (without Preview or Navigator) in main area.
CodeChat transforms source code to a web page, interpreting comments as reStructuredText. See https://pythonhosted.org/CodeChat/README.html for details. If that's enabled, I was wondering if the preview sync was causing problems. But, given the Preview window isn't open, that's not the cause.
I don't have an idea why this happens and how to fix this. Seems like Qt bug. I don't have this bug on Linux Mint 17.3 Qt 5.2.1 and up to date Qt (something like 5.5.x) Closing the issue because there is nothing to do about it. @vi, try to update or downgrade your Qt. I hope you'll stay on Enki master, it has many improvements compared with previous version.
My current Qt:
libqt5gui5:
Installed: 5.3.2+dfsg-4+deb8u1
Where shall I look to try debugging the issue on my side?
Can you prepare, for example, a branch with verbose logging regarding to scrolling and viewport changes?
I don't have an idea why this happens.
Check if the bug reproduces on editor.py
from Qutepart. If it does - check pure QPlainTextEdit.
Reproducible with editor.py:
./editor.py editor.py
Qutepart is fdc29c79eb6f3228897cfb713e047bf1d9a48198
Reproduced also with QPlainTextEdit (copied editor.py
changed qpart = QPlainTextEdit()
and removed extras)
Hacky workaround:
class MyPTE(QPlainTextEdit):
def wheelEvent(self, ev):
import time
t = time.time()
try:
if t - self.lastScrollEventTime < 0.2:
super().wheelEvent(ev)
except AttributeError:
pass
self.lastScrollEventTime = t
Where to insert it to QutePart?
qutepart/init.py Qutepart class 25 марта 2016 г. 13:02 пользователь "Vitaly Shukela" < notifications@github.com> написал:
Hacky workaround:
class MyPTE(QPlainTextEdit): def wheelEvent(self, ev): import time t = time.time() try: if t - self.lastScrollEventTime < 0.2: super().wheelEvent(ev) except AttributeError: pass self.lastScrollEventTime = t
— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/hlamer/enki/issues/396#issuecomment-201225788
Applied workaroud, now Enki scrolls well.
Suppose viewport is at about 50% and I'm scrolling down (52%, 55% ...). At 60% I stop scrolling and click at some line. After that I continue scrolling down. But instead of going further down it "jumps" up, for example, at 40% before proceeding down. It does not happen with Ctrl+up/down scrolling.
Also, despite of being usual C file, Enki does not display Navigator and syntax highlight looks very partial (
void
,#include
,static
,for
,// TODO
,int
is highlighted, but notstruct
,int16_t
,unsigned
)