protesilaos / ef-themes

Colourful and legible themes for GNU Emacs
GNU General Public License v3.0
331 stars 18 forks source link

Parenthesis in org-block are not using fixed pitch #19

Closed zealotrush closed 2 years ago

zealotrush commented 2 years ago

Hi, Prot

As stated in the title, parenthesis (including (), [] and {}, but not <>) in org-block are not using fixed-pitch faces. It seems like a bug. Here is a screenshot for demonstrating this issue.

image

PS: this issue doesn't exist in c-mode. PPS: modus-themes doesn't have this issue.

UPDATE

I found that it is related to the tree-sitter package I'm using. Ef-themes doesn't support this package, while modus-themes does. So, this should not be think of as a bug, rather a missing feature, I guess.

protesilaos commented 2 years ago

Hello @zealotrush!

I also notice that there is a white background behind them, which suggests that something else is also in effect. When I type this code on my end, I do not get that white background.

zealotrush commented 2 years ago

Hello @zealotrush!

I also notice that there is a white background behind them, which suggests that something else is also in effect. When I type this code on my end, I do not get that white background.

Thanks! I totally missed the white background. By pressing C-u C-x = with the cursor placing on the ( character, I found the faces are:

  (rainbow-delimiters-depth-1-face tree-sitter-hl-face:punctuation.bracket org-block)

Then, by clicking on the tree-sitter-hl-face:punctuation.bracket entry, I got:

Defined in ‘org-faces.el’.
...
       Background: #f7f9f9
...
          Inherit: ef-themes-fixed-pitch

I guess this is where the white background comes from.

protesilaos commented 2 years ago

Very well! Please tell me how you enable tree-sitter so I can take a look.

zealotrush commented 2 years ago

Here is my tree-sitter related config.

(use-package tree-sitter
  :defer t
  :config (global-tree-sitter-mode)
  :hook (tree-sitter-after-on . tree-sitter-hl-mode))
(use-package tree-sitter-langs)
protesilaos commented 2 years ago

Thank you! I just added support for the tree-sitter faces. The problem was that the underlying face inherited from default, hence the variable-pitch and the use of the main background.

Please confirm that the change fixes the issue on your end.

zealotrush commented 2 years ago

Please confirm that the change fixes the issue on your end.

It's fixed now. Thank you!

image
protesilaos commented 2 years ago

Great!