fix the weird line shift after staging file#1371
Closed
liangkarl wants to merge 0 commit intojonas:masterfrom
Closed
fix the weird line shift after staging file#1371liangkarl wants to merge 0 commit intojonas:masterfrom
liangkarl wants to merge 0 commit intojonas:masterfrom
Conversation
koutcher
reviewed
Mar 25, 2025
src/status.c
Outdated
| return false; | ||
| } | ||
|
|
||
| if (line->type != LINE_STAT_STAGED && !no_files_staged) |
Collaborator
There was a problem hiding this comment.
Good catch but wrong solution, this code is needed in the plain status view. However we should not call it in the "Untracked only" status view:
diff --git a/src/status.c b/src/status.c
index 1e79cb82..82a52bec 100644
--- a/src/status.c
+++ b/src/status.c
@@ -652,7 +652,7 @@ status_update(struct view *view)
return false;
}
- if (line->type != LINE_STAT_STAGED && !no_files_staged)
+ if (!show_untracked_only && line->type != LINE_STAT_STAGED && !no_files_staged)
view->pos.lineno += 1;
return true;
Author
There was a problem hiding this comment.
Got it. Thanks for the explanation! : )
Author
There was a problem hiding this comment.
So, do I need to close the PR, or will you close it after committing the changes?
Collaborator
There was a problem hiding this comment.
Leave it open, I'll use it to commit the changes.
koutcher
added a commit
that referenced
this pull request
Apr 11, 2025
Original-patch-by: Karl Liang <liang.karl@outlook.com>
ee13c63 to
0199bab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a bug with an incorrect line shift. After entering the stage window and staging any file in the main view, you will find a weird line shift, jumping two lines instead of one.
Reproduce steps
touch a b c duto stage any file