Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log view fixes #1128

Merged
merged 3 commits into from
Oct 4, 2021
Merged

Log view fixes #1128

merged 3 commits into from
Oct 4, 2021

Conversation

koutcher
Copy link
Collaborator

No description provided.

if (code != SUCCESS)
return code;

watch_register(&view->watch, WATCH_HEAD | WATCH_REFS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, I just have a related question - I can't figure out how to make set refresh-mode = after-command work. It doesn't refresh after I run :!echo and type q.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must say that I don't use it either. Wondering if anyone does... WATCH_EVENT_AFTER_COMMAND seems to be trigged only after opening an editor or running a command requiring confirmation.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehm, yeah, the refresh code is really buggy unfortunately. It probably needs to be completely redesigned. Might be better to rip it out.

src/draw.c Outdated
@@ -543,12 +543,13 @@ view_column_draw(struct view *view, struct line *line, unsigned int lineno)
{
enum line_type type = line->type;
const char *text = column_data.text;
size_t indent;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be initialized since we only set it to get_graph_indent(text) if line->graph_indent is non-zero?

Suggested change
size_t indent;
size_t indent = 0;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the initialisation and the use are conditioned by line->graph_indent but, agreed, it never hurts to initialise a variable in case someone wants to use it in the future and misses this condition.

if (code != SUCCESS)
return code;

watch_register(&view->watch, WATCH_HEAD | WATCH_REFS);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehm, yeah, the refresh code is really buggy unfortunately. It probably needs to be completely redesigned. Might be better to rip it out.

@koutcher koutcher force-pushed the log-view-fixes branch 3 times, most recently from db9f856 to d15c917 Compare October 2, 2021 10:45
Support for `tig log --graph` was added in 2.0 with fa2fcc9 but was
later broken in 2.2 with 178c45c when the box structure was
implemented. This makes it work again, though it would be cleaner
to move the implementation from draw.c to log.c and pager.c,
using the box structure.
@koutcher koutcher merged commit 34fb640 into jonas:master Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants