Comments (10)
Recently I rewrote the codes of buffer info, and the performance is much better than before, especially for remote files. Please update and try the fancy styles.
truncate-upto-project
truncate-from-project
truncate-with-project
truncate-except-project
from doom-modeline.
Thanks for the information!
I checked your Emacs configurations, and recreated this issue locally. I believe the root cause is projectile
. refer to bbatsov/projectile#657. I think the configuration could fix this issue in this case: (setq doom-modeline-buffer-file-name-style 'file-name)
. Please try.
from doom-modeline.
It seems that the project root is always the same for a given buffer, so do we really need to call projectile-project-root
on every motion? I use the following code to cache the value, I think it fixes the issue:
(defun my-cache-project-root (orig-fn &rest args)
(if (local-variable-p 'my-project-root)
my-project-root
(setq-local my-project-root (apply orig-fn args))))
(advice-add 'doom-modeline-project-root :around #'my-cache-project-root)
from doom-modeline.
Hello, based on the information, it's really hard to dig out the root cause.
Would you please provide more details?
- OS
- Emacs version
doom-modeline
version- Emacs configurations
- what files? It's better provide the examples with address and credential.
- other clues
My guess is the remote files may be not in the project or vcs, but not 100% sure. Need more information to troubleshooting.
from doom-modeline.
Of course:
- The issue occurs when accessing a raspberry pi (raspbian jessie) over ssh from both a pc (arch linux) and a laptop (ubuntu), as well as when accessing the pc over ssh from the laptop.
- Emacs version 26.1
- Doom-modeline version 20181001.1514 from melpa
- My current emacs init
- Any file I access over /ssh:pilocal:/path/to/file
- Because you suggested that the problem might be with projects or vcs I decided to open a file in a folder with a git repository, and to my surprise, the lag went away! I don't think I would have thought to test this myself, and being quite inexperienced at emacs I also don't know how to fix it...
from doom-modeline.
That indeed fixed the issue. I did come across the projectile bug, but didn't think it affected me because the issue persisted when projectile-mode was off.
Thanks for your support and your work!
from doom-modeline.
Welcome! Glad to know the issue has been fixed.
I am considering to add this to FAQ.
from doom-modeline.
@envypole It's a good idea to optimize the performance. I'll try to merge although it should be in projectile
IMO.
from doom-modeline.
I am still hitting this issue while editing remote files, even with the new truncate-*-project
settings. Removing the update-buffer-file-name
hook makes the issue go away.
(add-hook 'after-change-functions #'doom-modeline-update-buffer-file-name)
Is it really necessary to update the buffer file name after every change? Perhaps this could be controlled by a user-facing variable?
See below for a sample profile of a typical editing session. Note that almost all of the CPU time for self-insert-command
is eaten up by doom-modeline-update-buffer-file-name
.
- self-insert-command 58 17%
- doom-modeline-update-buffer-file-name 56 17%
- doom-modeline-buffer-file-name 56 17%
- doom-modeline--buffer-file-name 41 12%
+ file-relative-name 28 8%
+ file-local-name 1 0%
+ file-local-name 14 4%
+ doom-modeline-update-buffer-file-state-icon 1 0%
+ electric-pair-post-self-insert-function 1 0%
from doom-modeline.
@ashiklom You are right! It's for updating the modified
status after changing the buffer. It works well for the local files but I have to agree it can be optimized.
Updated: I committed a change to optimize it.
from doom-modeline.
Related Issues (20)
- Can the 'which-function' be disabled? HOT 2
- [Bug] buffer-position formatting won't respect flags in format specifier for column HOT 4
- [Bug] Lightbulb symbol 01F4A1 not displaying in mode line HOT 3
- [Feature Request] display-all-git-branches HOT 2
- [Bug] Icons on modeline lack sufficient padding HOT 14
- [Bug] modeline fragments do not get updated correctly when a command that changes the current-buffer is running HOT 3
- [Bug] HOT 3
- [Bug] Setting a left window margin clips the modeline on the right HOT 4
- [Bug] Compiler warnings after 311a0c5 HOT 1
- Fix the few faces that don't inherit from doom-modeline HOT 1
- Symbol’s function definition is void: doom-modeline-check-icon HOT 4
- [Bug] Typo in commit 3f1d33a
- Differentiate error states for checker segment HOT 1
- [Bug] Error during redisplay HOT 1
- [Bug] Reference to free variable `keel-menu-map' after 1d0942d HOT 2
- [Feature Request] new doom-modeline-buffer-file-name-style project-and-filename
- help-echo text not showing when in lsp-mode[Bug] HOT 4
- [Bug] Space inconsistency between `buffer-position` and `selection-info` HOT 7
- [Bug] Compiler warnings about `meow*` functions
- [Bug] Error during redisplay: (eval (doom-modeline-segment--check) t) signaled (args-out-of-range 1 1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doom-modeline.