Author Topic: All code editor views seem to be fixed width  (Read 7171 times)

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
All code editor views seem to be fixed width
« 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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: All code editor views seem to be fixed width
« Reply #1 on: April 03, 2020, 02:54:46 pm »
Does the same happen in notepad++?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: All code editor views seem to be fixed width
« Reply #2 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?

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: All code editor views seem to be fixed width
« Reply #3 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++.


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: All code editor views seem to be fixed width
« Reply #5 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?

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: All code editor views seem to be fixed width
« Reply #6 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)

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: All code editor views seem to be fixed width
« Reply #7 on: April 03, 2020, 05:31:06 pm »
Clarification: I tries SciTE 3.7.5.


Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: All code editor views seem to be fixed width
« Reply #9 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.

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: All code editor views seem to be fixed width
« Reply #10 on: April 03, 2020, 05:50:11 pm »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: All code editor views seem to be fixed width
« Reply #11 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...

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: All code editor views seem to be fixed width
« Reply #12 on: April 03, 2020, 08:47:20 pm »
I made a ticket so it wont get lost:
https://sourceforge.net/p/codeblocks/tickets/941/

Offline mimi89999

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: All code editor views seem to be fixed width
« Reply #13 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: All code editor views seem to be fixed width
« Reply #14 on: April 03, 2020, 09:48:20 pm »
This was discussed recently...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]