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

performance: throttle titlebar screen updates during loading #622

Merged
merged 1 commit into from
Jun 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ blame_read(struct view *view, struct buffer *buf, bool force_stop)
if (!state->commit) {
state->commit = read_blame_commit(view, buf->data, state);
string_format(view->ref, "%s %2zd%%", view->vid,
view->lines ? state->blamed * 100 / view->lines : 0);
view->lines ? 5 * (size_t) (state->blamed * 20 / view->lines) : 0);

} else if (parse_blame_info(state->commit, state->author, buf->data)) {
bool update_view_columns = true;
Expand Down
5 changes: 4 additions & 1 deletion src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,10 @@ update_view_title(struct view *view)
wprintw(window, " - %s %d of %zd",
view->ops->type,
line->lineno,
view->lines - view->custom_lines);
MAX(line->lineno,
Copy link
Owner

Choose a reason for hiding this comment

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

👍

view->pipe
? 100 * (size_t) ((view->lines - view->custom_lines) / 100)
: view->lines - view->custom_lines));
}

if (view->pipe) {
Expand Down