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.28k stars 158 forks source link

modeline cuts off when resizing with default-text-scale #329

Closed spicyriceball closed 4 years ago

spicyriceball commented 4 years ago

Describe Description says it all: the right-hand side of my doom modeline has been cut off because I'm using the package default-text-scale to zoom. This is a nonissue in most buffers, except when flycheck is involved (images in additional context). A hotfix I've discussed on the doom server is adding a small space padding to the right, but it would be best if something more foolproof was done. Steps and Expected Steps to reproduce the behavior: It should account for the resizing and move it left if possible or something along those lines.

Please reproduce with emacs -Q and provide the minimal configurations and steps.

Using this (either as init file or with emacs -Q --load /path/to/thisfile):

Minimal Configuration ```lisp ;; -*- lexical-binding: t -*- (require 'package) (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (package-initialize) (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (eval-when-compile (require 'use-package)) (use-package use-package :config (setq-default use-package-always-defer nil use-package-always-ensure t use-package-always-demand t byte-compile-warnings nil)) (use-package doom-themes :custom (doom-vibrant-brighter-comments t) (doom-vibrant-brighter-modeline t) :config (doom-themes-org-config) (load-theme 'doom-dracula t)) (line-number-mode t) (column-number-mode t) (use-package doom-modeline :custom (doom-modeline-icon t) (doom-modeline-major-mode-icon t) (doom-modeline-version t) (doom-modeline-buffer-file-name-style 'file-name) :config (doom-modeline-mode)) (use-package default-text-scale :init (default-text-scale-mode)) (use-package flycheck :config (setq flycheck-check-syntax-automatically '(mode-enabled save)) :init (global-flycheck-mode)) ```

Just try to use the default-text-scale package (binding to zoom should be C-M-= based off vanilla minimal above. I normally zoom to 140ish on a 15 in screen).

Environment:

Additional context Just a couple of screenshots I shared on the doom server as well (note: they were taken with my custom config, but it should translate and showcase the issue fine).

Dashboard Flycheck

A little tangential, but I suspect it could be related to #141 possibly? I could be totally wrong.

seagle0128 commented 4 years ago

It's not related to #141. I think you should enable default-text-scale-mode before doom-modeline-mode. Since doom-modeline caches the font info for better performance, the display may not be correct after changing the font size.

spicyriceball commented 4 years ago

I see, so I would need to predefine the size in my init file like so:

(default-text-scale-increase)
(default-text-scale-increase)

Is it possible to turn caching off or force overwrite? I sometimes have to use external monitors and would like to change my size on the fly.

seagle0128 commented 4 years ago

It's not a good idea to turn off it. My recommendation is

  1. Use C-x C-= to increase the font size manually.
  2. Call doom-modeline-refresh-font-width-cache after default-text-scale functions.
seagle0128 commented 4 years ago

I submitted a patch to be compatible with this package (I hope). The solutions above still work.