When follow-mode is enabled for a buffer, this will show a segment left
of buffer-info (which contains the file name) like "Follow M/N", where N
is the total number of follow windows for this buffer and M is the index
of the selected window.
* rename flymake--backend-state to flymake--state
s.a. 6e10086901
* adding alias for flymake--backend-state
This way the code should be compatible with old and new versions of
flymake.
Recently the [change in vc-git in emacs](3572613550)
broke modeline state in remote files as it prepends a string in the
beginning and cannot retrieve relative file path to pass as git command
argument.
The fix here ensures that the prefix in the beginning of the file path
doesn't break the `(vc-state)` command by passing local file name of the
remote files.
Fix#463
The cached bar segment is only updated if it is active (that is: the hud
is not active), and drawing the segment relies on the cache being
up-to-date. This could cause problems if the bar is reconfigured while
inactive, and then activated.
Fix this by updating the cache when drawing if not populated yet, and
changing `doom-modeline-refresh-bars` to unconditionally invalidate it.
Both the bar and hud segment were invalidating their cache from
`window-configuration-change-hook`, which should not be necessary: the
bar segment should not care about window configuration at all, and the
hud segment should detect buffer position changes correctly on redraw.
These extra invalidations mask problems like the one this commit fixes.
Remove the unnecessary invalidations.
Co-authored-by: Vincent Zhang <seagle0128@gmail.com>
This is a small graphical indicator showing the rough size of and
position in the current buffer. It is not used by default in any
modeline, but is intended to be usable as a replacement of the "bar"
segment.
To avoid performance problems, cache the HUD images as window
parameters. When rendering the modeline, we check if the buffer
position (or size) has changed enough to change the image, and reuse the
image if not. This check should be similar in performance to rendering
buffer size or position. Changing bar width or height forcibly
invalidates all cached images, so they get redrawn as the modeline in
each window is rendered.
This only adds the segment. To use it, define a new modeline.
If tab-bar is hidden by setting tab-bar-show nil, tab-bar-mode is nil
but still new tabs can be created by tab-bar-new-tab. Modeline
workspace-name should be displayed even if tab-bar is hidden.
workspace-name doesn't bother you when tab-bar has only one tab.
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.
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.
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>
[Boon](https://github.com/jyp/boon) is a modal mode for Emacs. This
commit adds support for Boon in the modal segment.
Boon has four states:
- Command (like Evil's normal)
- Insert
- Special (mostly pass-through, much like Evil's Emacs mode)
- Off, used when Boon really doesn't know what to do. There is no real
equivalent in Evil; this commit uses the same face as Evil's
operator state for this one. It's arbitrary, but it probably doesn't
matter too much.