Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: mimi89999 on April 03, 2020, 01:55:15 pm

Title: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 01:55:15 pm
All code editor views seem to be fixed width. In the code editor or any other view with scintilla like _Syntax highlighting_ settings there is a horizontal scrollbar and I can see that the width of the editor is much larger that what would be required to fit the longest line of code. If I open a file with a very long line, it gets cropped and the view width stays the same.

I have this issue on trunk on Debian 10 with GTK3 and in 20.03 on Windows 10, so it doesn't seem to be platform dependent.
Title: Re: All code editor views seem to be fixed width
Post by: BlueHazzard on April 03, 2020, 02:54:46 pm
Does the same happen in notepad++?
Title: Re: All code editor views seem to be fixed width
Post by: BlueHazzard on April 03, 2020, 02:56:17 pm
What if you enable word wrap?
Settings->Editor->General settings->Other editor settings->Word wrap

Can you post a screenshot?
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 03:19:00 pm
With Word wrap enable I don't have this issue. I will fire a VM and check Notepad++.
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 03:31:51 pm
https://lebihan.pl/files/Screenshot_win10_2020-04-03_15:23:34.png
https://lebihan.pl/files/Screenshot_win10_2020-04-03_15:24:01.png
https://lebihan.pl/files/Screenshot_win10_2020-04-03_15:24:26.png
https://lebihan.pl/files/Screenshot_win10_2020-04-03_15:24:35.png

Notepad++ 7.8.5 isn't affected, but they might be using a different version of Scintilla.
Title: Re: All code editor views seem to be fixed width
Post by: BlueHazzard on April 03, 2020, 04:33:49 pm
ok, i can see the first also here..
but for me all characters are displayed, so it does seem that only the bar is displayed wrongly, but no characters missing. Can you confirm this?
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 04:41:23 pm
I didn't count the `s`, but you can see on https://lebihan.pl/files/Screenshot_win10_2020-04-03_15:24:01.png that the closing double quote and semicolon are missing. You can see them in https://lebihan.pl/files/Screenshot_win10_2020-04-03_15:24:26.png.

The issue doesn't appear until you close Code::Blocks. You need to create a new file, write a long line, save the file, exit C::B, open C::B and open the file again. The line will be cropped.

I tried SciTE and couldn't reproduce.

Note that Notepad++ is using Scintilla 4.2.x and C::B 3.7.5 (https://sourceforge.net/p/codeblocks/code/HEAD/tree/trunk/src/sdk/wxscintilla/src/scintilla/version.txt)
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 05:31:06 pm
Clarification: I tries SciTE 3.7.5.
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 05:37:00 pm
https://lebihan.pl/files/Screenshot_win10_2020-04-03_17:33:49.png
https://lebihan.pl/files/Screenshot_win10_2020-04-03_17:34:35.png
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 05:39:33 pm
The window is still too wide, but at least the view grows when a file with a long line is open.
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 05:50:11 pm
It's a known issue: https://sourceforge.net/p/scintilla/bugs/1226/
Title: Re: All code editor views seem to be fixed width
Post by: BlueHazzard on April 03, 2020, 08:44:49 pm
Ok, i see and i can reproduce this:

1) Create a new file
2) Create a long line within this file (lets say at least 2000 characters...
3) Save the file
4) Close the file
5) Open the file again
6) The scroll bar will not be updated and display a default with. If you use the scroll bar to go to the end of the line it will crop of. You still can use the arrow keys to go to the end.
Also using the end key works...



To circumvent this bug, you can select the line and press the "end" key on the keyboard. This will bring you to the end of the line, and will update the scrollbar...
Title: Re: All code editor views seem to be fixed width
Post by: BlueHazzard on April 03, 2020, 08:47:20 pm
I made a ticket so it wont get lost:
https://sourceforge.net/p/codeblocks/tickets/941/
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 09:20:51 pm
It's actually a feature. It's controlled by the `scroll_width_tracking` setting variable. The setting can be found in settings -> editor configuration -> margins and caret -> scrollbar: Automatically [...]

It's a Scintilla setting. It's explained in: https://www.scintilla.org/ScintillaDoc.html#SCI_SETSCROLLWIDTHTRACKING

I think that the default should be changed to true.
Title: Re: All code editor views seem to be fixed width
Post by: oBFusCATed on April 03, 2020, 09:48:20 pm
This was discussed recently...
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 03, 2020, 09:49:58 pm
Link?
Title: Re: All code editor views seem to be fixed width
Post by: oBFusCATed on April 04, 2020, 10:11:18 am
I don't have one. I suppose it is related to the gtk3 bug about this.
Title: Re: All code editor views seem to be fixed width
Post by: mimi89999 on April 04, 2020, 10:18:25 am
Couldn't find the discussion, but found another report of this issue: https://sourceforge.net/p/codeblocks/tickets/930/
Title: Re: All code editor views seem to be fixed width
Post by: BlueHazzard on April 04, 2020, 11:47:07 am
Interesting... Thank you for finding this out! I updated the ticket you posted with a link to here...