Commit graph

227 commits

Author SHA1 Message Date
Vincent Zhang
05b213ff98 Improve force redisplay advice.
The issue has been fixed in 29. The workaround should only work for old versions.
2021-11-24 20:07:42 +08:00
Vincent Zhang
b59802efba [Refactor] Add doom-modeline-wspc. 2021-11-06 22:48:51 +08:00
Vincent Zhang
25e81e77cd Revert "Improve the workaround: avoid window flicker."
This reverts commit aed094c437.
Close #485.
2021-10-25 01:20:23 +08:00
Vincent Zhang
5d55484576 Improve hooks for active windows. 2021-10-19 00:11:19 +08:00
Vincent Zhang
aed094c437 Improve the workaround: avoid window flicker. 2021-10-18 22:43:11 +08:00
memeplex
084370d7a9
Improve force redisplay advice (#484)
* Improve force redisplay advice

By unconditionally advising `split-window' we ensure that redisplay:

1. Always triggers in the right window, so it solves an issue with
`org-attach' calling `fit-window-to-buffer' from a different window.

2. It's not tied to a buffer that may outlive its popup, so it solves
the issue with `org-set-tags-command' which buffer kept lurking around
with `doom-modeline--size-hacked-p' set to t.

As all known workarounds, this will trigger a quick sequence
redisplay -> fit -> redisplay that causes some little flickering when
the window effectively changes size in-between (which is usually the
case with popups).

Moreover, `fit-window-to-buffer' always transforms a height in pixels
to a height in characters and this operation unavoidably rounds up
to the next integer height in characters when the mode-line is of a
different size than the default character, hence introducing some
small amount of padding at the bottom of the window.

In order to avoid small but yet unpleasant visual artifacts whenever
possible, we only trigger a redisplay when it is strictly required,
that is when the mode-line height effectively differs from the default
character height.

To facilitate the construction of a "vanilla height" modeline when
`doom-modeline-height' <= 0 and `doom-modeline-icon' is nil we ensure
that this simpler modeline will be created, no matter the platform.

* Allow unhacked modeline with icons

Allow a modeline with default height to have icons.

It's recommended to also set `all-the-icons-scale-factor' to 1 in
order to ensure that the modeline will indeed have default height.
2021-10-18 22:21:39 +08:00
Tarjei Bærland
2a0eb1f800
Fix typo in doc string (#481) 2021-10-17 16:29:37 +08:00
Vincent Zhang
af99ef6625 Fix docstring warnings. 2021-10-01 01:09:41 +08:00
Vincent Zhang
5ed7a1bd0e Set doom-modeline-project-detection to auto. 2021-08-24 00:06:28 +08:00
Vincent Zhang
f5a994a52c project-roots is obsolete. 2021-08-21 17:17:25 +08:00
Vincent Zhang
ffb9e38828 Enable icons by default. 2021-08-07 17:22:36 +08:00
Vincent Zhang
51af51d248 Enhance timemachine segment. 2021-07-22 02:33:30 +08:00
Vincent Zhang
77cd244ae5 Don't display icons in TUI. 2021-07-21 16:45:40 +08:00
Vincent Zhang
07d03c4626 [Feature] Support citre-mode. 2021-06-28 01:31:51 +08:00
Vincent Zhang
4938937d86 [Enhancement] Respect all-the-icons-font-families.
Close #395.
2021-06-21 02:15:04 +08:00
Vincent Zhang
d785f37163 Fit modeline items under emacsclient with daemon.
Close #455.
2021-06-20 02:56:46 +08:00
Vincent Zhang
a9186b7cee Fix #455: Fit modeline items under emacsclient with daemon. 2021-06-19 04:57:06 +08:00
Vincent Zhang
7b93a4188f The font width is always 1 in terminal. 2021-06-19 03:55:36 +08:00
Vincent Zhang
d514f43679 Refactor. 2021-06-08 13:16:28 +08:00
Vincent Zhang
f963cbb42f [Refactor] Restore to original format while disabling. 2021-05-27 15:03:11 +08:00
Vincent Zhang
b8e24f1a75 Revert "New option: doom-modeline-bar."
This reverts commit 1784e392d7.

Close #447.
2021-05-27 02:33:14 +08:00
marienz
0466d88d71
Add a minimum height for the hud's middle part (#445)
This looks nicer, and it also makes sure it is not possible to try to
draw an image with a negative height for the middle part (which might
happen if window-start and buffer-size are out of sync).
2021-05-21 19:22:37 +08:00
Vincent Zhang
1784e392d7 New option: doom-modeline-bar.
Whether to display the bar to indicate active and inactive windows.
It's only respected in GUI.
2021-05-16 22:27:49 +08:00
Vincent Zhang
22563e68df Refactor. 2021-05-16 22:09:24 +08:00
Vincent Zhang
a89ac6c7a1 New option: doom-modeline-hud.
Whether to use hud instead of default bar. It's only respected in GUI.
2021-05-15 03:52:00 +08:00
Vincent Zhang
0531669f59 Format and eliminate warnings. 2021-05-13 22:09:27 +08:00
Vincent Zhang
e1ca326ae9 Fix #437: When visual-fill-column mode is activated perspectives are not shown. 2021-05-10 12:40:08 +08:00
marienz
e898c0d396
Support hiding buffer encoding when at default (#435)
Only showing the buffer encoding and EOL style when they are
interesting (not at their default values) makes them stand out more when
needed, and frees up space when not. Users currently cannot hide the
coding-system and EOL segments separately, and would have to watch for
changes to `buffer-file-coding-system` to toggle visibility. Since
doom-modeline reads these values already anyway, we can easily add
support.

Add a new value `'nondefault` for `doom-modeline-buffer-encoding` to
enable this feature.

Add two new settings to set the default. Detecting the user's defaults
is tricky: Emacs does not use a single variable for the default coding
system but a prioritized list, and hooks can (and do, on Windows) change
the defaults. For now, hardcode reasonable "default defaults" and allow
the user to customize them.

Reorganize slightly to minimize work done if we choose not to display a
segment. Behavior when the new feature is not used should be unchanged.
2021-04-27 22:59:10 +08:00
marienz
92f141f91a
Simplify image creation (#432)
Switch from an XPM to a PBM bitmap: PBM is easier to generate and easier
for Emacs to decode. Emacs has PBM support built-in so it's always
available (keep the `image-type-available-p` check in case this changes).

Stop creating a temporary list-of-lists to iterate over.

Rename `doom-modeline--make-xpm` to `doom-modeline--make-image` because
it's no longer creating an XPM, and the type of the bitmap should not
matter to callers.
2021-04-19 17:58:09 +08:00
Waqar Hameed
3433275efe
Add face for notifications (#431)
There is a face for the number part of
notifications (`doom-modeline-unread-number`), however, none for the
notification itself. For symmetry, we introduce
`doom-modeline-notification` as a face for notifications. We also set
the default value to `doom-modeline-warning` to keep the previous
behavior.

Signed-off-by: Waqar Hameed <whame91@gmail.com>
2021-04-12 14:40:01 +08:00
Bruno Heridet
669cac3839
fix: typos in comments and docstrings (#429) 2021-03-30 23:22:24 +08:00
Nacho Barrientos
0a7b36d7ed
Fix typo (#428) 2021-03-22 23:17:25 +08:00
Vincent Zhang
1a5b142deb Fix #416: Focus does not change properly on switching buffers. 2021-03-02 18:32:36 +08:00
Vincent Zhang
1d8d8f885d Be compatible with mini-frame.
Close #419.
2021-02-28 01:47:57 +08:00
Vincent Zhang
5fe7fd677c Fix #417: Modeline looks unfocused when using exwm. 2021-02-23 17:41:22 +08:00
Vincent Zhang
116c733fd5 Remove redundant advices. 2021-01-25 00:10:37 +08:00
Vincent Zhang
85f653a2b9 Update window-selection-change hook.
Close #412.
2021-01-25 00:02:22 +08:00
Vincent Zhang
26b90b2ec9 Eliminate compilation warnings. 2021-01-24 01:56:27 +08:00
Vincent Zhang
4956606a54 Only set icon widths in UI mode.
See #403.
2021-01-07 22:07:22 +08:00
Jim Myhrberg
d8d04332f5
Add option to show/hide workspace-name in modeline (#371) 2020-08-24 10:30:46 +08:00
Vincent Zhang
ffbaaee832 Activate the mode-line upon changing workspace in EXWM.
Fix #358.
2020-08-19 09:17:34 +08:00
Vincent Zhang
a846653ae6 Fix #369: doom-modeline-segment--lsp signaled wrong-type-argument. 2020-07-31 01:35:50 +08:00
Morten Kristensen
203111a3af
Improve indent info by showing correct indent size by major mode
Instead of using `tab-width` for space indentation size, the correct indentation size variable is
tried detected per major mode. If nothing can be found, it will fall back to `tab-width` as before.
2020-07-21 18:47:19 +02:00
Nicholas Vollmer
1f3956f6ae Refactor: doom-modeline-propertize-icon use cl-destructuring-bind 2020-07-19 02:14:39 -04:00
Vincent Zhang
1c4711c719 Enhance face: doom-modeline-debug-visual. 2020-07-04 18:56:35 +08:00
Vincent Zhang
40a8abf0cc Declare the proper type for doom-modeline-continuous-word-count-modes.
Fix #361.
2020-07-04 17:14:20 +08:00
Vincent Zhang
a921eeba1e Ignore lv windows while getting the current window.
Fix #227.
2020-07-02 01:17:13 +08:00
Vincent Zhang
f57d1afae8 Refresh font width cache while using emacsclient to make a new frame.
Close #354, #356.
2020-06-21 21:50:14 +08:00
Vincent Zhang
8904f5d631 Fix #352: The modeline interval color of the inactive window is wired. 2020-06-12 21:28:51 +08:00
Vincent Zhang
c90ae9de9b New faces: doom-modeline-spc-face and doom-modeline-vspc-face.
Fix #351.
2020-06-10 22:47:20 +08:00