magiblot / turbo

An experimental text editor based on Scintilla and Turbo Vision.
Other
466 stars 36 forks source link

Background color issue when line numbers are enabled #27

Closed electroly closed 2 years ago

electroly commented 2 years ago

Hi @magiblot, I'm seeing an issue in drawing the background of some blank cells when line numbers are enabled. Some cells are black instead of the expected background color; thus, this is not detectable when the editor background is black. I pulled turbo commit 3545036ea9bc9eae4b2361168ff90eefd58729c5 and applied the following diff to source/turbo-core/styles.cc:

diff --git a/source/turbo-core/styles.cc b/source/turbo-core/styles.cc
index 370b9fd..cad997a 100644
--- a/source/turbo-core/styles.cc
+++ b/source/turbo-core/styles.cc
@@ -123,7 +123,7 @@ Language detectFileLanguage(const char *filePath)

 extern constexpr ColorScheme schemeDefault =
 {
-    /* sNormal           */ {{}      , {}                       },
+    /* sNormal           */ {{}      , '\x9'                    },
     /* sSelection        */ {'\x1'   , '\x7'                    },
     /* sWhitespace       */ {'\x5'   , {}                       },
     /* sCtrlChar         */ {'\xD'   , {}                       },

Then I get the result shown in the animation below. I get the same behavior in tmbasic with its fully customized color scheme. It's not quite random but I don't know what's going on. The issue vanishes if I disable line numbers. I reproduced in Windows/conhost and in Linux/PuTTY. Let me know if you want me to git bisect this. Cheers!

magiblot commented 2 years ago

Hi Brian, sorry for the bug. I have known this issue for some time, but had not looked into it yet. Don't worry, I'll take care of it.

magiblot commented 2 years ago

Fixed. Thanks for the report!

electroly commented 2 years ago

I can confirm the fix is working. Thank you!