diff --git a/tig.c b/tig.c index a7190bc60..7c597242b 100644 --- a/tig.c +++ b/tig.c @@ -5142,7 +5142,7 @@ tree_draw(struct view *view, struct line *line, unsigned int lineno) } static void -open_blob_editor(const char *id) +open_blob_editor(const char *id, unsigned int lineno) { const char *blob_argv[] = { "git", "cat-file", "blob", id, NULL }; char file[SIZEOF_STR] = "/tmp/tigblob.XXXXXX"; @@ -5153,7 +5153,7 @@ open_blob_editor(const char *id) else if (!io_run_append(blob_argv, fd)) report("Failed to save blob data to file"); else - open_editor(file, 0); + open_editor(file, lineno); if (fd != -1) unlink(file); } @@ -5178,7 +5178,7 @@ tree_request(struct view *view, enum request request, struct line *line) if (line->type != LINE_TREE_FILE) { report("Edit only supported for files"); } else if (!is_head_commit(view->vid)) { - open_blob_editor(entry->id); + open_blob_editor(entry->id, 0); } else { open_editor(opt_file, 0); } @@ -5375,7 +5375,7 @@ blob_request(struct view *view, enum request request, struct line *line) { switch (request) { case REQ_EDIT: - open_blob_editor(view->vid); + open_blob_editor(view->vid, (line - view->line) + 1); return REQ_NONE; default: return pager_request(view, request, line);