Since version 2.0, if I paste a large chunk of text (more than 1 screen
Please provide an exact and detailed recipe for reproducing the problem.
1. Open the Geany manual: https://www.geany.org/manual/current/index.html 2. Select all text (Ctrl-A) and copy it (Ctrl-C). 3. Create a new file in Geany (Ctrl-N) 4. Paste that text in this new file.
Result:
The last line I see in my editing window is #3624, while the last line of text is #3732.
5. Paste the text at the end of the file 6 more times, and then select all text and copy it, go to the end of file and paste the text.
Result:
I see that the positioning in the text jumps twice rather than once.
Please always paste the first few lines of `Help->Debug Messages` (down to and including OS, no need to expose your personal directories)
The last line I see in my editing window is No.3624, while the last line of text is No.3732. (Means positioning is incorrect).
How do you know its 3732?
I get that file only having 3478 lines copying it from chrome, which browser did you use? (Geany does not open web addresses unless your OS has some magic extension, in which case you need to talk to them). Chrome developer tools say `index.html` has 7346 lines and my local copy of `index.html` has 7346 lines, so clearly the browser isn't passing it raw, so if you use a different browser you may get a different answer.
In either case the cursor is at the end of the file after I paste, no matter how many times I paste, or copy and paste (well as many times until I get bored ;-)
Its likely that the user has turned on Line Wrapping which is a background process and may take over 10 seconds on a large file. After the text has been added scrolling is performed before any wrapping of the new lines. While there could be attempts to scroll to the new caret position as wrapping is progressed this may conflict with other user actions like manual scrolling.
Ok, can replicate with a small file, with wrap on pasting wrapping lines to a position close to the bottom of the screen leaves the screen in a position where the cursor is not visible, but with wrapping off it always leaves the cursor visible.
scrolling is performed before any wrapping of the new lines.
would explain it, and no need for big files or slow wrapping.
Yes, I have Line Wrapping on, so that may be the cause.
Could someone please remove the 'Waiting for information'-label from this issue?
Closed #3666 as completed.
Seems to be answered, closed
Seems to be answered, closed
In my last comment, I didn't ask to close the issue. I asked to remove the 'Waiting for information'-label from the issue. The issue is still there, at least in Geany 1.38. I don't know if the issue is in Geany 2.0 because I don't have Geany 2.0. But because there is no entry for a solution in this issue, I can imagine that the issue still exists in Geany 2.0.
@elextr Could you please try to reproduce the issue in Geany 2.0? If the issue is still there, could you please reopen the issue?
To test the issue: Copy a very very long text. Open a new tab in Geany. Activate in Geany in 'Document' the entry 'Line wrapping'. Then paste the text. The question is: Is the cursor in the visible area, yes or no? If no is the answer, then the issue still exists.
@ralf3u my comment [above](https://github.com/geany/geany/issues/3666#issuecomment-1788533664) is post Geany 2.0 release, so it would have been what was used.
The issue has been explained:
1. wrapping lots of text is slow 2. so its performed in background whilst allowing display to continue, including scrolling to the cursor position, so it does not appear that the paste didn't happen 3. but when wrapping is complete it can change the display since wrapped lines on screen can occupy more space, pushing the cursor off screen
There is no good "solution" to this, wrapping is always going to be slow, so freeze the display until it finishes? Pretty much unacceptable I would have said. Scrolling after wrapping is an issue since there is no way of knowing if a scroll position is set by the system or the user, and positions set by users must not be changed by the system.
If the cursor is off-screen and you want it back, just move it one position left or right.
There is no good "solution" to this, wrapping is always going to be slow, so freeze the display until it finishes? Pretty much unacceptable I would have said.
That's not my position. My position is: Freezing the display is better than a disappearance of the cursor.
If I do the test in the editor Featherpad when 'Wrap Lines' is activated, then the cursor does not disappear.
My position is: Freezing the display is better than a disappearance of the cursor.
You are of course entitled to your opinion, but the Scintilla developers (and its other users) clearly subscribe to the other opinion since they went to the effort of making wrap work in background so it wouldn't freeze.
If I do the test in the editor Featherpad when 'Wrap Lines' is activated, then the cursor does not disappear.
Turning wrap lines on and off is a little different to pasting lots, but in fact it demonstrates the Scintilla behaviour very well, if you turn on wrap the same line remains at the top of the display, so if lines between the top of the display and the cursor wrap then the cursor is forced down.
Turning wrap lines on and off is a little different to pasting lots, [...]
In FeatherPad I didn't turn on and off 'Wrap Lines', I did the test from https://github.com/geany/geany/issues/3666#issuecomment-1972693169. The test is:
Copy a very very long text. Open a new tab in Geany. Activate in Geany in 'Document' the entry 'Line wrapping'. Then paste the text. The question is: Is the cursor in the visible area, yes or no? If no is the answer, then the issue still exists.
So I did this in FeatherPad: Copy a very very long text. Open a new tab in FeatherPad. Activate in FeatherPad in 'Options' the entry 'Wrap Lines'. Then paste the text. The cursor does not disappear.
Turning wrap lines on and off is a little different to pasting lots
I was using that to demonstrate the Scintilla behaviour in a simple way.
I am not sure what the point is, so one application has made a different decision to another, so what? Neither is an oracle for "correctness", they are just different.
I am not sure what the point is, so one application has made a different decision to another, so what?
I just wanted to demonstrate that it is possible.
wrapping lots of text is slow
I can't confirm this in FeatherPad.
[...] the Scintilla developers (and its other users) clearly subscribe to the other opinion since they went to the effort of making wrap work in background so it wouldn't freeze.
Maybe this decision was taken when computers were slow. Nowadays a computer is so powerful. But maybe I'm wrong. So, I have the intention to open a new issue at Scintilla if not a closed issue already exits to the subject. Maybe the developers will rethink them position. If I will make a comment at Scintilla, I will post here the issue number.
Interestingly here, even without wrapping, featherpad freezes for 4-5 seconds just pasting `geany.html` 12 times, but Geany is instantaneous, but Geany takes 1-2 seconds to wrap the resulting file if the edit window is about 40 characters wide but featherpad is instantaneous. Maybe featherpad is caching information when opening so wrapping is fast. Given it is done by Qt who knows.
Note that people run apps line Geany and Scite on machines like raspberry pi, so not all machines can be assumed to be hypercomputers :grin:
Interestingly here, even without wrapping, featherpad freezes for 4-5 seconds just pasting geany.html 12 times, but Geany is instantaneous, but Geany takes 1-2 seconds to wrap the resulting file if the edit window is about 40 characters wide but featherpad is instantaneous. Maybe featherpad is caching information when opening so wrapping is fast. Given it is done by Qt who knows.
Thank you for your test.
Note that people run apps line Geany and Scite on machines like raspberry pi, so not all machines can be assumed to be hypercomputers
That's true, indeed.
I recognized that the editor Kate and the editor Geany have the same behavior. It seems to be that developers of big software don't like a freezing behavior because it is a break in the flow, and the flow seems to be holy.
I think a good comprise would be to offer two Line Wrapping: - Line Wrapping without freezing the display - Line Wrapping with freezing the display
But I can imagine that it will not be realized because the effort is enormous while the use is low. Nevertheless at Scintilla I could write this: Add the possibility to switch between 'Line Wrapping without freezing the display' and 'Line Wrapping with freezing the display'.
What do you think?
[...] to offer two Line Wrapping
An other solution could be to offer only one Line Wrapping, and in the Preferences one can deactivate a checkbox at `Line Wrapping without freezing the display`.
Well I think you said it, possibly lot of work for Scintilla for little return. But you can always ask, but don't be surprised or upset if its no. If Scintilla provides an option then "somebody" can make a PR to add it to Geany.
But the general approach these days is to make more features asynchronous, like Language Servers, they can be slow, so freezing is unacceptable, and when they return their output a while later it might mean re-wrapping if they cause changes to the display which makes more freezing. So in general any freezing is frowned on.
developers of big software don't like a freezing behavior because it is a break in the flow, and the flow seems to be holy.
Not so much the developers as the users, who kick up an un-holy ;-) racket if things freeze.
I just opened a new ticket at Scintilla: https://sourceforge.net/p/scintilla/feature-requests/1513/
The title of the ticket is: `Add the option "Line Wrapping without freezing the display"`
github-comments@lists.geany.org