Repository navigation
fix(ediff): restore chat side-window after ediff session - #41
Conversation
|
@CsBigDataHub Unfortunatelly same behavior, the eca-chat becomes the only displayed window for some reason, differently than via smerge |
Maybe something to do with how doom emacs manage the windows? I cannot replicate it with my configs. |
|
Yeah maybe, I have no idea tho |
|
Doom's popup system https://github.com/doomemacs/doomemacs/tree/master/modules/ui/popup |
enhance ediff integration to detect and adapt to Doom Emacs popup contexts prevent eca-diff and Ediff control buffers from being managed by Doom popups avoid saving/restoring window configuration when in Doom popup to prevent conflicts add doom-aware cleanup and error recovery, using Doom's popup restoration when needed use longer delay for window restoration under Doom for reliability ensure chat buffer is re-displayed correctly after ediff session or error refactor buffer and window management logic for improved compatibility and robustness
|
@ericdallo Please test now, added support to doom popup rules. |
|
@CsBigDataHub yeah, that works! I'm just wondering the complexity we added for that, especially with the previous PR, I'm wondering if we should have a |
|
Yes and no. For code maintainability and elegance - yes. No, as I do not anticipate many improvements to this code. I vote for YES, please do not merge this. let me decouple and push. |
|
@ericdallo please test, decoupled diff from eco-chat.el. Works well on my end. |
| (defun eca-chat--parse-unified-diff (diff-text) | ||
| "Compatibility wrapper that delegates to `eca-diff-parse-unified-diff'. | ||
|
|
||
| DIFF-TEXT is the unified diff string to parse and returns the parsed | ||
| plist produced by `eca-diff-parse-unified-diff'." | ||
| (eca-diff-parse-unified-diff diff-text)) | ||
|
|
||
| (defun eca-chat--show-diff-ediff (path diff) | ||
| "Compatibility wrapper delegating to `eca-diff-show-ediff'. | ||
|
|
||
| PATH is the file path being shown and DIFF is the unified diff text. | ||
| This wrapper passes the current buffer as CHAT-BUF so `eca-diff' can | ||
| restore the chat display after Ediff quits." | ||
| (eca-diff-show-ediff path diff (current-buffer) (lambda (b) (ignore-errors (eca-chat--display-buffer b))))) | ||
|
|
||
|
|
||
| (defun eca-chat--show-diff-smerge (path diff) | ||
| "Compatibility wrapper delegating to `eca-diff-show-smerge'. | ||
|
|
||
| PATH is the file path being shown and DIFF is the unified diff text. | ||
| This wrapper passes the current buffer as CHAT-BUF so `eca-diff' can | ||
| restore the chat display after smerge quits." | ||
| (eca-diff-show-smerge path diff (current-buffer) (lambda (b) (ignore-errors (eca-chat--display-buffer b))))) |
There was a problem hiding this comment.
Do we need these 3 functions? can't we just do what they do inside the pcase below?
There was a problem hiding this comment.
Just want to keep it clean and maintainable.
There was a problem hiding this comment.
I see low level and more indirection having like that, but no big deal too, I'm ok keeping it
@ericdallo please try this fix.