Compare commits
2 commits
5b077a8581
...
c507fb905d
Author | SHA1 | Date | |
---|---|---|---|
c507fb905d | |||
980529029f |
3 changed files with 11 additions and 2 deletions
|
@ -291,7 +291,8 @@ pub fn main() anyerror!void {
|
||||||
|
|
||||||
for (links.items) |link| {
|
for (links.items) |link| {
|
||||||
try file_link.navigate(tui_proc.ref(), &link);
|
try file_link.navigate(tui_proc.ref(), &link);
|
||||||
} else {
|
}
|
||||||
|
if (links.items.len == 0) {
|
||||||
if (!have_project)
|
if (!have_project)
|
||||||
try tui_proc.send(.{ "cmd", "open_project_cwd" });
|
try tui_proc.send(.{ "cmd", "open_project_cwd" });
|
||||||
try tui_proc.send(.{ "cmd", "show_home" });
|
try tui_proc.send(.{ "cmd", "show_home" });
|
||||||
|
|
|
@ -93,7 +93,8 @@ fn process_git(self: *Self, m: tp.message) MessageFilter.Error!bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_status(self: *Self, m: tp.message) MessageFilter.Error!bool {
|
fn process_status(self: *Self, m: tp.message) MessageFilter.Error!bool {
|
||||||
defer Widget.need_render();
|
defer if (tui.frames_rendered() > 0)
|
||||||
|
Widget.need_render();
|
||||||
|
|
||||||
var value: []const u8 = undefined;
|
var value: []const u8 = undefined;
|
||||||
var ahead: []const u8 = undefined;
|
var ahead: []const u8 = undefined;
|
||||||
|
|
|
@ -61,6 +61,7 @@ fontface_: []const u8 = "",
|
||||||
fontfaces_: std.ArrayListUnmanaged([]const u8) = .{},
|
fontfaces_: std.ArrayListUnmanaged([]const u8) = .{},
|
||||||
enable_mouse_idle_timer: bool = false,
|
enable_mouse_idle_timer: bool = false,
|
||||||
query_cache_: *syntax.QueryCache,
|
query_cache_: *syntax.QueryCache,
|
||||||
|
frames_rendered_: usize = 0,
|
||||||
|
|
||||||
const keepalive = std.time.us_per_day * 365; // one year
|
const keepalive = std.time.us_per_day * 365; // one year
|
||||||
const idle_frames = 0;
|
const idle_frames = 0;
|
||||||
|
@ -449,6 +450,7 @@ fn receive_safe(self: *Self, from: tp.pid_ref, m: tp.message) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(self: *Self) void {
|
fn render(self: *Self) void {
|
||||||
|
defer self.frames_rendered_ += 1;
|
||||||
const current_time = std.time.microTimestamp();
|
const current_time = std.time.microTimestamp();
|
||||||
if (current_time < self.frame_last_time) { // clock moved backwards
|
if (current_time < self.frame_last_time) { // clock moved backwards
|
||||||
self.frame_last_time = current_time;
|
self.frame_last_time = current_time;
|
||||||
|
@ -1184,6 +1186,11 @@ pub fn need_render() void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn frames_rendered() usize {
|
||||||
|
const self = current();
|
||||||
|
return self.frames_rendered_;
|
||||||
|
}
|
||||||
|
|
||||||
pub fn resize() void {
|
pub fn resize() void {
|
||||||
mainview_widget().resize(screen());
|
mainview_widget().resize(screen());
|
||||||
refresh_hover();
|
refresh_hover();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue