seagle0128 / doom-modeline

A fancy and fast mode-line inspired by minimalism design.
https://seagle0128.github.io/doom-modeline/
GNU General Public License v3.0
1.29k stars 159 forks source link

[Bug] Space inconsistency between `buffer-position` and `selection-info` #721

Closed schickele closed 5 months ago

schickele commented 6 months ago

Thank you for the bug report

Bug description

There is a small visual inconsistency between the buffer-position and the selection-info segments. When buffer-position displays a percent position, both segments are separated by two spaces. If the buffer position is instead equal to Top, Bot or All, they are separated by one space. Here is a small demonstration:

bilder_joined_a

This is especially noticeable if you highlight the selection-info segment like I like to do:

bilder_joined_b

Steps to reproduce

Visit a file and select a region.

Expected behavior

Two separation spaces in every case would be a visually more pleasing solution IMHO. I'm a elisp beginner and I'm not able to draft a pull request myself.

OS

Linux

Emacs Version

29

Emacs Configurations

Vanilla Emacs or Doom Emacs

Error callstack

No response

Anything else

No response

seagle0128 commented 6 months ago

@schickele I realized and rolled back my comment. You happen to see it :cry:

It's related to doom-modeline-percent-position.

schickele commented 5 months ago

Thanks a lot! It's perfect now:

bilder_joined

sebastiaanspeck commented 5 months ago

At my side, this commit introduced some unwanted behaviour. It shows the buffer-position two times:

image
;; doom-modeline - A minimal and modern mode-line
;; https://github.com/seagle0128/doom-modeline
(use-package doom-modeline
  :pin "melpa-latest"
  :hook ((after-init . doom-modeline-mode)
     (emacs-startup . display-time)))

It got introduced by this change:

image
seagle0128 commented 5 months ago

@sebastiaanspeck Are you using the latest version? I cannot reproduce this issue.

sebastiaanspeck commented 5 months ago

@sebastiaanspeck Are you using the latest version? I cannot reproduce this issue.

I am using the latest version indeed. Is there any way to help you to reproduce?

sebastiaanspeck commented 5 months ago
image

I do have column-number-mode and line-number-mode disabled, but enabled global-display-line-numbers-mode.

If I turn on column-number-mode or line-number-mode the first percentage is replaced with the contents of the column-number or line-number.

This is a screenshot with both column-number-mode and line-number-mode enabled:

image

But since I have my line-number in the left-fringe, I do not need the column-number and line-number in my modeline.

seagle0128 commented 5 months ago

@sebastiaanspeck Gotcha. Already fixed.