diff --git a/src/stage.c b/src/stage.c index 156fb5ece..1b0a92e2f 100644 --- a/src/stage.c +++ b/src/stage.c @@ -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; @@ -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, @@ -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: