Merge pull request #143 from jonvaldes/refresh-rate-setting

Adding a setting to change the refresh rate
macos-click-through
Keith Simmons 5 years ago committed by GitHub
commit 7f248fcd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -183,6 +183,7 @@ impl Settings {
settings.insert("no_idle".to_string(), Setting::new_bool(no_idle));
settings.insert("extra_buffer_frames".to_string(), Setting::new_u16(buffer_frames));
settings.insert("refresh_rate".to_string(), Setting::new_u16(60));
Settings { neovim_arguments, settings: Mutex::new(settings) }
}

@ -215,7 +215,8 @@ pub fn ui_loop() {
}
let elapsed = frame_start.elapsed();
let frame_length = Duration::from_secs_f32(1.0 / 60.0);
let refresh_rate = SETTINGS.get("refresh_rate").read_u16() as f32;
let frame_length = Duration::from_secs_f32(1.0 / refresh_rate);
if elapsed < frame_length {
sleep(frame_length - elapsed);
}

Loading…
Cancel
Save