Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Qt5 build] Find tool breaks editor in document with long line and enabled word-wrap #4996

Closed
pintassilgo opened this issue Apr 16, 2023 · 9 comments
Labels

Comments

@pintassilgo
Copy link

Tested with factory reset CudaText (all default).

https://gist.githubusercontent.com/pintassilgo/9704632c3ce21e4ee9d68918ddd57da0/raw/gistfile1.txt

  1. Save this file and open it with with Cuda.
  2. Enable word wrap (menu bar > View > check "Toggle word-wrap").
  3. Open Find tool with Ctrl+F, then enable "Wrapped search" ('O' button or use the hotkey Ctrl+Alt+N).
  4. Type "cached".
  5. Press F3 a few times to jump to next match

Suddenly, editor will become blank. There are 7 matches for "cached", the ones causing the bug are the last three. Apparently, some bug is causing Cuda to create a strange horizontal scrollbar that shouldn't exist (because word-wrap is enabled).

@pintassilgo
Copy link
Author

pintassilgo commented Apr 16, 2023

In second 6 of the recorded video, I clicked View in menubar and enabled word-wrap, but the recorded video can't show it.

You can see that when editor becomes blank a strange horizontal scrollbar appears. There shouldn't exist horizontal scrollbar in word-wrap mode. The editor is blank because document content is to the left of current position in this strange horizontal scrollbar.

cuda.mp4

@Alexey-T Alexey-T added the bug label Apr 16, 2023
@Alexey-T
Copy link
Owner

Alexey-T commented Apr 16, 2023

Hm, I renamed the folder 'settings' but I cannot repro this (last 3 matches show OK with word-wrap). @veksha @Vivalzar Do you have repro with clean settings?

@veksha
Copy link
Contributor

veksha commented Apr 16, 2023

can't reproduce too

@pintassilgo
Copy link
Author

pintassilgo commented Apr 16, 2023

Maybe it's a bug in the qt5 build. I just tested with the gtk2 and I can't reproduce with it.

@Alexey-T
Copy link
Owner

yes, I see it now in qt5 build.

@pintassilgo
Copy link
Author

qt5 build is problematic, #4955 is similar: gtk2 is not affected, but qt5 is.

@pintassilgo pintassilgo changed the title Find tool breaks editor in document with long line and enabled word-wrap [Qt5 build] Find tool breaks editor in document with long line and enabled word-wrap Apr 16, 2023
@Alexey-T
Copy link
Owner

Alexey-T commented Apr 16, 2023

found the reason.
on qt5, WrapInfo calculation had a bug.
I did in console:

f=open('text','w')
l=ed.get_wrapinfo()
for i in l: f.write(str(i)+'\n')

and found bad item in wrapinfo. fixing. Thanks!

Alexey-T added a commit to Alexey-T/ATSynEdit that referenced this issue Apr 16, 2023
@Alexey-T
Copy link
Owner

Alexey-T commented Apr 16, 2023

problematic line in Console-made logfile was:

Screenshot from 2023-04-16 13-33-30

left file - is bad. 'final':0 was bug.

@Alexey-T
Copy link
Owner

App updated to 1.191.0.4.

z4ziggy added a commit to z4ziggy/CudaText that referenced this issue Apr 19, 2023
  > better apply Screen.HintFont for hints
  > for Alexey-T#5005
  > for Alexey-T#5005
  > cmt
  > fix bug in wrapinfo calculation with unicode text, Alexey-T#4996
  > refac
  > rename vars
  > add typecast to Int64
  > fix in UpdateScrollbars, set horz pos to 0 if word-wrap on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants