Skip to content

Commit

Permalink
Fix navigation between chunks after splitting chunk
Browse files Browse the repository at this point in the history
Also fix the color of the first split chunk.

Closes #1101
  • Loading branch information
koutcher committed Nov 11, 2021
1 parent 15aab28 commit 9b59fc9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "tig/status.h"
#include "tig/main.h"
#include "tig/stage.h"
#include "tig/search.h"

static struct status stage_status;
static enum line_type stage_line_type;
Expand Down Expand Up @@ -320,8 +321,10 @@ stage_insert_chunk(struct view *view, struct chunk_header *header,
int i;

box = from->data;
for (i = 0; i < box->cells; i++)
for (i = 0; i < box->cells; i++) {
box->cell[i].length = 0;
box->cell[i].type = LINE_DIFF_CHUNK;
}

if (!append_line_format(view, from, "@@ -%lu,%lu +%lu,%lu @@",
header->old.position, header->old.lines,
Expand Down Expand Up @@ -607,6 +610,7 @@ stage_request(struct view *view, enum request request, struct line *line)
return REQ_NONE;
}
stage_split_chunk(view, line);
reset_search(view);
return REQ_NONE;

case REQ_EDIT:
Expand Down

0 comments on commit 9b59fc9

Please sign in to comment.