diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index 83fd060..e3fb8dc 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -265,13 +265,10 @@ impl Options { config.hold = self.hold; config.window.dimensions = self.dimensions.unwrap_or(config.window.dimensions); + config.window.title = self.title.unwrap_or(config.window.title); config.window.position = self.position.or(config.window.position); config.window.embed = self.embed.and_then(|embed| embed.parse().ok()); - if let Some(title) = self.title { - config.window.title = title.clone(); - } - if let Some(class) = self.class { let parts: Vec<_> = class.split(',').collect(); config.window.class.instance = parts[0].into(); diff --git a/alacritty_terminal/src/grid/storage.rs b/alacritty_terminal/src/grid/storage.rs index b4ff70a..10091f2 100644 --- a/alacritty_terminal/src/grid/storage.rs +++ b/alacritty_terminal/src/grid/storage.rs @@ -1,3 +1,4 @@ +use std::cmp::Ordering; /// Wrapper around Vec which supports fast indexing and rotation /// /// The rotation implemented by grid::Storage is a simple integer addition. @@ -94,10 +95,10 @@ impl Storage { T: Clone, { let current_history = self.len - (self.visible_lines.0 + 1); - if history_size > current_history { - self.grow_lines(history_size - current_history, template_row); - } else if history_size < current_history { - self.shrink_lines(current_history - history_size); + match history_size.cmp(¤t_history) { + Ordering::Greater => self.grow_lines(history_size - current_history, template_row), + Ordering::Less => self.shrink_lines(current_history - history_size), + _ => (), } } diff --git a/copypasta/src/wayland_clipboard.rs b/copypasta/src/wayland_clipboard.rs index 7b9de83..0fd154e 100644 --- a/copypasta/src/wayland_clipboard.rs +++ b/copypasta/src/wayland_clipboard.rs @@ -37,6 +37,12 @@ pub fn create_clipboards(display: &Display) -> (Primary, Clipboard) { (Primary { context: context.clone() }, Clipboard { context }) } +/// Create new clipboard from a raw display pointer. +/// +/// # Safety +/// +/// Since the type of the display is a raw pointer, it's the responsibility of the callee to make +/// sure that the passed pointer is a valid Wayland display. pub unsafe fn create_clipboards_from_external(display: *mut c_void) -> (Primary, Clipboard) { let context = Arc::new(Mutex::new(WaylandClipboard::new_from_external(display as *mut wl_display)));