-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update on file changes #292
base: master
Are you sure you want to change the base?
Conversation
Thats cool! I read through it and think it makes sense. I haven't tested it myself, or read the code in-depth. (I'm on vacation until February). Could be a configurable option. I wonder if it works on windows/mac? I'd wish for the cursor to remain at the selected line post updates ):, though, that is a separate problem. |
64b8c86
to
9dd0dba
Compare
(Rebased onto #293) |
Tested this on Linux and it works great! Just need to fix a little glitch that happens when
Looks like the cursor remains at the literal selected line number, which may have different information on it after the update. So I guess at each notify event if you were to calculate how many lines have been added/removed you could jump the cursor by that number of lines in the opposite direction maybe? |
9dd0dba
to
7a5380c
Compare
Whoops, that paths[0] was a silly testing thing I forgot to change. Fixed, thanks! I'm on a mac and it works here. Can't easily test Windows though. The |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #292 +/- ##
==========================================
- Coverage 88.40% 87.96% -0.44%
==========================================
Files 62 63 +1
Lines 5578 5608 +30
==========================================
+ Hits 4931 4933 +2
- Misses 647 675 +28 ☔ View full report in Codecov by Sentry. |
@sbillig what do you think of making it possible to disable this via config? Enabled per default. There's a module "config.rs" I believe. |
This adds a file watcher (using the
notify
crate); when any files have been modified/created/removed/etc in the work directory, we do a screen update and redraw. I found gitu today and have been using it in zed as a magit substitute, and am really liking it so far (thanks!). I thought it would be nice to not have to manually refresh gitu.The gitignore filter probably isn't necessary; if an ignored file is modified and triggers an extra update/redraw, it doesn't really matter. Or it could be more complete (eg I don't think we're currently filtering out files in
.git/
for example). 🤷Happy to make changes or whatever as you see fit.
Screen.Recording.2024-12-16.at.11.06.15.PM.mov