Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line numbers / OCD issue #67

Open
extrowerk opened this issue Jan 15, 2024 · 1 comment
Open

Line numbers / OCD issue #67

extrowerk opened this issue Jan 15, 2024 · 1 comment

Comments

@extrowerk
Copy link

Hi, thanks for turbo, i am using it on OpenBSD 7.4 and it works very well.
However, it looks like this on my computer:

turbo

As you can see, the line numbers horizontally aligned to the right side of the cell. For some reason this disturbs me. Would it be possible to move the line numbers into the middle of the column? Or at least add 1 or 2 spaces behind the number, so it won't stick to the border. Thank You very much!

@extrowerk extrowerk changed the title Line numbers OCD issue Line numbers / OCD issue Jan 15, 2024
@magiblot
Copy link
Owner

Hi @extrowerk!

I'm very glad that you find Turbo to be worthy of being your go-to editor.

Even though it would be possible to change the alignment of the line numbers, I never intended the editor UI to look as ugly as it currently does in your terminal. I believe the root problem is the mismatch between the border color and background color. It looks certainly better when these match.

Given that persistent configuration is not yet in place, this cannot be simply solved by customizing the color scheme. Therefore, if you are able to edit the source code and recompile the program, I suggest you try changing the file source/turbo-core/basicwindow.cc like this:

diff --git a/source/turbo-core/basicwindow.cc b/source/turbo-core/basicwindow.cc
index 0f22797..4d80e0a 100644
--- a/source/turbo-core/basicwindow.cc
+++ b/source/turbo-core/basicwindow.cc
@@ -100,29 +100,29 @@ void BasicEditorWindow::handleNotification(const SCNotification &scn, Editor &ed
 
 extern constexpr WindowColorScheme windowSchemeDefault =
 {
-    /* wndFramePassive             */ '\x07',
-    /* wndFrameActive              */ '\x0F',
-    /* wndFrameIcon                */ '\x0A',
+    /* wndFramePassive             */ {{}, {}},
+    /* wndFrameActive              */ {{}, {}, slBold},
+    /* wndFrameIcon                */ {'\xA', {}},
     /* wndScrollBarPageArea        */ '\x30',
     /* wndScrollBarControls        */ '\x30',
-    /* wndStaticText               */ '\x0F',
-    /* wndLabelNormal              */ '\x07',
-    /* wndLabelSelected            */ '\x0F',
-    /* wndLabelShortcut            */ '\x06',
+    /* wndStaticText               */ {{}, {}, slBold},
+    /* wndLabelNormal              */ {{}, {}},
+    /* wndLabelSelected            */ {{}, {}, slBold},
+    /* wndLabelShortcut            */ {'\x6', {}},
     /* wndButtonNormal             */ '\x20',
     /* wndButtonDefault            */ '\x2B',
-    /* wndButtonSelected           */ '\x2F',
+    /* wndButtonSelected           */ {'\xF', '\x2', slBold},
     /* wndButtonDisabled           */ '\x78',
     /* wndButtonShortcut           */ '\x2E',
-    /* wndButtonShadow             */ '\x08',
-    /* wndClusterNormal            */ '\x07',
-    /* wndClusterSelected          */ '\x0F',
-    /* wndClusterShortcut          */ '\x06',
+    /* wndButtonShadow             */ {'\x8', {}},
+    /* wndClusterNormal            */ {{}, {}},
+    /* wndClusterSelected          */ {{}, {}, slBold},
+    /* wndClusterShortcut          */ {'\x6', {}},
     dialogColor(wndInputLineNormal         ),
     dialogColor(wndInputLineSelected       ),
     dialogColor(wndInputLineArrows         ),
     /* wndHistoryArrow             */ '\x20',
-    /* wndHistorySides             */ '\x02',
+    /* wndHistorySides             */ {'\x2', {}},
     dialogColor(wndHistWinScrollBarPageArea),
     dialogColor(wndHistWinScrollBarControls),
     dialogColor(wndListViewerNormal        ),
@@ -130,7 +130,7 @@ extern constexpr WindowColorScheme windowSchemeDefault =
     dialogColor(wndListViewerSelected      ),
     dialogColor(wndListViewerDivider       ),
     dialogColor(wndInfoPane                ),
-    /* wndClusterDisabled          */ '\x08',
+    /* wndClusterDisabled          */ {'\x8', {}},
 };

This will make the window borders respect the terminal's default colors, just like the text editing area does. Maybe this should be the default color scheme, since it adapts to both dark and light terminal color themes:

Screenshot_20240115_233528

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants