eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.12k stars 456 forks source link

[Bug]: Editor caret fall behind typing #3220

Closed iHardRock closed 1 year ago

iHardRock commented 1 year ago

What happened?

v17.4.0 from latest master. Ubuntu 22.04 Unity

When typing, caret fall behind entered text. Also chars may overlay each other. Seems like text width is wider than calculated caret position. It leads to incorrect text insertion and deletion. You can't set correct position even with mouse. Sometime go to the next line with Enter helps.

simplescreenrecorder-_2_

Another problem is line flickering when just move cursor.

simplescreenrecorder

Version

Self compiled

Operating system

Linux

Steps to reproduce

No response

Relevant log output

No response

eranif commented 1 year ago

This part is not really handled by CodeLite but by the underlying wxWidgets library Can you please:

iHardRock commented 1 year ago

Latest wxWidgets-3.2.2.1 from official site, compiled with ./configure --with-gtk=3 --prefix=/system/dev/library/wxwidgets-3.2 --enable-stl --with-liblzma

wxWidgets Library (wxGTK port)
Version 3.2.2 (Unicode: wchar_t, debug level: 1),
compiled at Jul  6 2023 02:10:02

Runtime version of toolkit used is 3.24.
Compile-time GTK+ version is 3.24.33.

Copyright (c) 1992-2023 wxWidgets team

CodeLite compiled with cmake -DCMAKE_BUILD_TYPE=Release -DMAKE_DEB=1 -DCOPY_WX_LIBS=0 -DWITH_WXPATH=/system/dev/library/wxwidgets-3.2/bin/ ..

изображение

eranif commented 1 year ago

Since you built wxWidgets yourself, can you please try the stc sample that comes with wxWidgets?

iHardRock commented 1 year ago

No issues.

simplescreenrecorder

eranif commented 1 year ago

can you confirm that the same font is being used?

iHardRock commented 1 year ago

Don't know how to figure out which font used in stc example. In source code it wxFONTFAMILY_TELETYPE / wxFONTFAMILY_MODERN.

Finally I have found the reason. Problem happens after import color and fonts settings from an older CodeLite (16.8.0 in my case).

What I have done:

  1. Delete self compiled CodeLite, rename .codelite folder to .codelite_old

  2. Install CodeLite from APT repository (ubuntu 22.04, CodeLite 14.0.0) No issues. Default font was Sans, but no issues. After changing font to Monospace Regular - no issues too.

  3. Remove CodeLite again, remove .codelite folder.

  4. Install compiled CodeLite. No issues. Default font is Monospace Regular.

  5. Import settings ZIP file that was exported from self-compiled 16.8.0 (not exactly, but something between 16.8.0 and 17.0.0, Ubuntu 20.04 Unity, GTK2) Problem appears.

I love Monokai color scheme, which was removed from CodeLite themes... May you suggest proper way how to bring this theme back? I can add and commit this theme to repository.

iHardRock commented 1 year ago

UPDATE

The main reason is not related to the import!

The main reason is change font size. Default font size is 14 (Monospace Regular). Problem appears with any theme if you change global font size.

  1. Open Color and Fonts. Default global font is Monospace Regular 14

  2. Change font size to 12. Problem appears.

  3. Change font size back to 14. No issue.

eranif commented 1 year ago

try a different font, this will make the problem go away.

About themes:

Since you are using a self compiled CodeLite, you can have many more themes, see here: https://docs.codelite.org/settings/colours_and_fonts/#installing-new-themes

I suggest to download the Alacritty themes (YAML format) from here: https://github.com/alacritty/alacritty-theme/tree/master/themes

and import them into CodeLite. You will be able to use Monokai Pro or another variant of it.

iHardRock commented 1 year ago

Please try to reproduce bug yourself by changing global font size to smaller one.

eranif commented 1 year ago

I did, can't make it happen here ...

/home/eran ubuntu $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy
iHardRock commented 1 year ago
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:    22.04
Codename:   jammy

But shell is Unity, not Gnome 3.

output

iHardRock commented 1 year ago

Setting different font size in CodeLite solves the problem. But not for all monospace fonts and their sizes))) Monospace Regular correct with 14 scale and 11. Ubuntu Mono Regular correct with 12 scale.

Ok, this is some kind of problems with wxWidgets vs Unity... Good news that now I know how to avoid this.