jonas / tig

Text-mode interface for git
https://jonas.github.io/tig/
GNU General Public License v2.0
12.49k stars 611 forks source link

Keep splitted view when coming back from a maximized view #1344

Open QDoussot opened 4 months ago

QDoussot commented 4 months ago

Old behavior

Example:

From Main view
 :enter      -> Main view | Status view
 :view-help  -> Help view
 :view-close -> Main view               (old behavior) 
 :view-close -> Main view | Status view (new behavior) 

Enable requested behaviors in https://github.com/jonas/tig/issues/336

koutcher commented 1 month ago

Thanks, unfortunately the PR breaks the auto-close behaviour of the maximized stage view when the last change is staged and this was not covered in the test suite, see below. I didn't check further, I think all views should be rechecked carefully.

diff --git a/test/stage/maximized-unstaged-changes-test b/test/stage/maximized-unstaged-changes-test
index bf571111..a3fee899 100755
--- a/test/stage/maximized-unstaged-changes-test
+++ b/test/stage/maximized-unstaged-changes-test
@@ -18,6 +18,8 @@ steps '
    :save-display split.screen
    :view-diff
    :save-display maximized.screen
+   :status-update
+   :save-display closed.screen
 '

 tigrc <<EOF
@@ -56,3 +58,17 @@ index e697dfd..9d8ef3d 100644
 --- a/.j
 [stage] Press '<Enter>' to jump to file diff - line 1 of 107                  9%
 EOF
+
+assert_equals 'closed.screen' <<EOF
+2014-05-25 19:42 +0000 Not Committed Yet o Staged changes
+2009-02-13 23:31 +0000 A. U. Thor        I [master] Initial commit
+
+
+
+
+
+
+
+
+[main] Staged changes                                                       100%
+EOF
QDoussot commented 1 month ago

Thanks for spotting it. Here is a fix for this particular behavior breaking, plus an update on the test according to the diff you provided. Do you have any idea of other specific behaviors to be tested ?