Open mar-mei opened 1 year ago
This is a limitation in order to keep the initial PR scoped, but you can manually update it via :reload
.
As @kirawi pointed out this is an intentional limitation of the current implementation as implementation file watching is challenging (and also has some other prerequisites like caching git repos) and therefore was too much to bundle with the initial implementation. I will be writing a poper tracking issue for my plans in that regard soon and close this issue then
I've just come up with a workaround using WezTerm: https://github.com/helix-editor/helix/issues/2261#issuecomment-1648036567.
Is it possible to get helix to automatically call reload-all
when it gets focused in the same way that auto-save
is triggered? It might be a reasonable temporary fix while file-watching is being worked on
@sidequestboy You can do that by introducing a new configuration option auto-reload-all
(defaults to false
). Afterward, you can make the reload_all function public, and call it here. However, the potential drawback is that it might trigger reload-all
too frequently. Moreover, in my opinion, we should avoid reloading unsaved changes buffers, as discussed in https://github.com/helix-editor/helix/issues/5680.
I have made a script to do this using "tmux" (set-hook).
bind-key g run-shell -b helix-lazygit
#!/bin/bash
# Split horizontally and run lazygit
tmux split-window -v -l 70% -c "#{pane_current_path}" lazygit
# run reload script on exit
tmux set-hook pane-exited "run-shell '$HOME/bin/helix-reload.sh'"
#!/bin/bash
# Data to be listed
LIST_DATA="#{pane_index} #{pane_current_command}"
# Find pane id where helix is running
HELIX_PANE_INDEX=$(tmux list-panes -a -F "$LIST_DATA" | grep "hx" | awk '{print $1}')
# Send reload command if such a pane exists
if [ -n "$HELIX_PANE_INDEX" ]; then
# change to helix pane
tmux select-pane -t $HELIX_PANE_INDEX
# Send ":" to start command input in Helix
tmux send-keys ":"
# Send the "reload-all" command to the pane that runs helix and simulate Enter
tmux send-keys "reload-all" C-m
fi
As @kirawi pointed out this is an intentional limitation of the current implementation as implementation file watching is challenging (and also has some other prerequisites like caching git repos) and therefore was too much to bundle with the initial implementation. I will be writing a poper tracking issue for my plans in that regard soon and close this issue then
@kirawi Hello. Is there any progress outlining this issue in more general terms? I guess this might be helpful, maybe someone else would be willing to work on this issue given a proper outline.
Summary
The UI of the new Git Gutter is not updated at git changes, such as a:
Reproduction Steps
I tried this: 1. `hx` 2. Open a file with a git repo 3. Make some changes 4. Save file 5. Run: `git commit -am "my changes"` in a new terminal I expected this to happen: UI is updated Instead, this happened: Git diff remains unchanged Only after a hx `:reload` of the file the ui ist updated --- ![hx](https://user-images.githubusercontent.com/43099631/205452154-97dfa959-5629-4d79-9839-08a03f6ea7f0.gif) ### Helix log~/.cache/helix/helix.log
``` please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines ```