meow-edit / meow

Yet another modal editing on Emacs / 猫态编辑
GNU General Public License v3.0
1.07k stars 128 forks source link

Line number indicator uses wrong face for lines starting with TAB #545

Closed theSuess closed 3 months ago

theSuess commented 3 months ago

When using meow-line in a file indented with TAB instead of SPACE, the face used to display line number indicators is not the same for indented lines. This messes with spacing and line height

meow-indicator-wrong

DogLooksGood commented 3 months ago

Hey, please share your font configuration.

theSuess commented 3 months ago

I'm using the following config:

    ;; Main typeface
    (set-face-attribute 'default nil :family "FantasqueSansM Nerd Font Mono" :height 140)
    ;; Set the fixed pitch face (monospace)
    (set-face-attribute 'fixed-pitch nil :family "FantasqueSansM Nerd Font Mono")
    ;; Set the variable pitch face
    (set-face-attribute 'variable-pitch nil :family "Atkinson Hyperlegible")
    ;; modeline
    (set-face-attribute 'mode-line nil :family "FantasqueSansM Nerd Font Mono" :height 140)
    (set-face-attribute 'mode-line-inactive nil :family "FantasqueSansM Nerd Font Mono" :height 140)

Let me know if you need any more information.

I'll try to reproduce this with a minimal configuration after work and share my findings here as well

theSuess commented 3 months ago

Alright, I've found a minimal example. Turns out the culprit is tab-width 2.

The following init.el reproduces the issue:

(require 'meow)

(meow-setup)
(meow-global-mode 1)
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)

Interestingly this does not happen with other tab widths (4,6 and 8 work fine)

DogLooksGood commented 3 months ago

I think you are missing a global font configuration, which should refers to "FantasqueSansM Nerd Font Mono" in your case.

(add-to-list 'default-frame-alist '('font . "FantasqueSansM Nerd Font Mono-14"))
(set-frame-font "FantasqueSansM Nerd Font Mono-14")
theSuess commented 3 months ago

I don't think this has anything to do with the font. The minimal init.el from my previous comment reproduces this issue without any custom font configuration (emacs 29 from the fedora package repo).

I've tried the global font configuration as well, but it does not have any effect

DogLooksGood commented 3 months ago

Okay, I think I can reproduce it.

DogLooksGood commented 3 months ago

Fixed with 6a12dc4

theSuess commented 3 months ago

Thanks for the great package and such a quick fix!