jdtsmith / indent-bars

Fast, configurable indentation guide-bars for Emacs
GNU General Public License v3.0
272 stars 7 forks source link

Customize the font weight of the character bar #26

Closed galeo closed 9 months ago

galeo commented 9 months ago

This pull request enables customizing the character bar width by setting the font weight.

jdtsmith commented 9 months ago

Thanks. Can you show a before and after picture? Also, did you first try heavy character bar (or maybe you are going lighter)?

I'd prefer letting the indent-bars-no-stipple-char-font-weight default be nil, then incorporating in the font specification only if the parameter is non-nil, ala:

,@(when indent-bars-no-stipple-char-font-weight `(:weight ,indent-bars-no-stipple-char-font-weight)) 
galeo commented 9 months ago

Thanks. Can you show a before and after picture?

Here is the example with default bar character .

The picture before:

Screen Shot 2023-10-08 at 07 46 24

The picture after applying this pull request (set indent-bars-no-stipple-char-font-weight to extra-light):

Screen Shot 2023-10-08 at 07 47 05

And with indent-bars-no-stipple-char-font-weight set to ultra-heavy:

Screen Shot 2023-10-08 at 07 52 10

Another example by customizing indent-bars-no-stipple-char to .

The picture before:

Screen Shot 2023-10-08 at 07 56 36

The picture after (set indent-bars-no-stipple-char-font-weight to extra-light):

Screen Shot 2023-10-08 at 07 57 17

With indent-bars-no-stipple-char-font-weight set to ultra-heavy:

Screen Shot 2023-10-08 at 07 57 50

Also, did you first try heavy character bar (or maybe you are going lighter)?

I've tried with the heavy character bar and it can achieve the same effect by customizing the font weight.

I'd prefer letting the indent-bars-no-stipple-char-font-weight default be nil, then incorporating in the font specification only if the parameter is non-nil, ala:

I think it's OK. However, nil is not a valid value for the font weight attribute and this maybe a misleading.

jdtsmith commented 9 months ago

Thanks, that looks great. We can simply document the custom variable like: "If non-nil, set the no-stipple character font weight accordingly." or similar.

galeo commented 9 months ago

I have done the modification as you described, please take a look.