|
33 | 33 |
|
34 | 34 | static char status_onbranch[SIZEOF_STR];
|
35 | 35 | static bool show_untracked_only = false;
|
| 36 | +static bool no_files_staged; |
36 | 37 |
|
37 | 38 | void
|
38 | 39 | open_status_view(struct view *prev, bool untracked_only, enum open_flags flags)
|
@@ -161,19 +162,23 @@ status_run(struct view *view, const char *argv[], char status, enum line_type ty
|
161 | 162 |
|
162 | 163 | if (!view->line[view->lines - 1].data) {
|
163 | 164 | add_line_nodata(view, LINE_STAT_NONE);
|
164 |
| - if (type == LINE_STAT_STAGED) |
| 165 | + if (type == LINE_STAT_STAGED) { |
165 | 166 | watch_apply(&view->watch, WATCH_INDEX_STAGED_NO);
|
166 |
| - else if (type == LINE_STAT_UNSTAGED) |
| 167 | + no_files_staged = true; |
| 168 | + } else if (type == LINE_STAT_UNSTAGED) { |
167 | 169 | watch_apply(&view->watch, WATCH_INDEX_UNSTAGED_NO);
|
168 |
| - else if (type == LINE_STAT_UNTRACKED) |
| 170 | + } else if (type == LINE_STAT_UNTRACKED) { |
169 | 171 | watch_apply(&view->watch, WATCH_INDEX_UNTRACKED_NO);
|
| 172 | + } |
170 | 173 | } else {
|
171 |
| - if (type == LINE_STAT_STAGED) |
| 174 | + if (type == LINE_STAT_STAGED) { |
172 | 175 | watch_apply(&view->watch, WATCH_INDEX_STAGED_YES);
|
173 |
| - else if (type == LINE_STAT_UNSTAGED) |
| 176 | + no_files_staged = false; |
| 177 | + } else if (type == LINE_STAT_UNSTAGED) { |
174 | 178 | watch_apply(&view->watch, WATCH_INDEX_UNSTAGED_YES);
|
175 |
| - else if (type == LINE_STAT_UNTRACKED) |
| 179 | + } else if (type == LINE_STAT_UNTRACKED) { |
176 | 180 | watch_apply(&view->watch, WATCH_INDEX_UNTRACKED_YES);
|
| 181 | + } |
177 | 182 | }
|
178 | 183 |
|
179 | 184 | io_done(&io);
|
@@ -644,6 +649,9 @@ status_update(struct view *view)
|
644 | 649 | return false;
|
645 | 650 | }
|
646 | 651 |
|
| 652 | + if (line->type != LINE_STAT_STAGED && !no_files_staged) |
| 653 | + view->pos.lineno += 1; |
| 654 | + |
647 | 655 | return true;
|
648 | 656 | }
|
649 | 657 |
|
|
0 commit comments