1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 13:21:38 +03:00

chore: run fmt

This commit is contained in:
rawnly 2023-12-02 18:50:45 +01:00 committed by Wez Furlong
parent 32a090e353
commit 6dbea8ff5e
7 changed files with 23 additions and 26 deletions

View File

@ -358,7 +358,6 @@ pub struct PaneSelectArguments {
pub show_pane_ids: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromDynamic, ToDynamic)]
pub enum CharSelectGroup {
RecentlyUsed,
@ -502,7 +501,6 @@ fn default_fuzzy_description() -> String {
"Fuzzy matching: ".to_string()
}
#[derive(Debug, Clone, PartialEq, FromDynamic, ToDynamic)]
pub enum KeyAssignment {
SpawnTab(SpawnTabDomain),

View File

@ -19,7 +19,6 @@ use std::sync::{Arc, Mutex};
use std::time::Duration;
use wezterm_dynamic::{FromDynamic, FromDynamicOptions, ToDynamic, UnknownFieldAction, Value};
pub mod window;
mod background;
mod bell;
mod color;
@ -40,6 +39,7 @@ mod tls;
mod units;
mod unix;
mod version;
pub mod window;
mod wsl;
pub use crate::config::*;

View File

@ -1,5 +1,4 @@
use wezterm_dynamic::{ToDynamic, FromDynamic};
use wezterm_dynamic::{FromDynamic, ToDynamic};
#[derive(Debug, Default, Clone, ToDynamic, PartialEq, Eq, FromDynamic)]
pub enum WindowLevel {
@ -8,4 +7,3 @@ pub enum WindowLevel {
Normal = 0,
AlwaysOnTop = 3,
}

View File

@ -1,6 +1,7 @@
use crate::inputmap::InputMap;
use config::keyassignment::*;
use config::{ConfigHandle, window::WindowLevel, DeferredKeyCode};
use config::window::WindowLevel;
use config::{ConfigHandle, DeferredKeyCode};
use mux::domain::DomainState;
use mux::Mux;
use ordered_float::NotNan;
@ -2057,14 +2058,11 @@ fn compute_default_actions() -> Vec<KeyAssignment> {
ScrollToBottom,
// ----------------- Window
ToggleFullScreen,
ToggleAlwaysOnTop,
ToggleAlwaysOnBottom,
SetWindowLevel(WindowLevel::AlwaysOnBottom),
SetWindowLevel(WindowLevel::Normal),
SetWindowLevel(WindowLevel::AlwaysOnTop),
SetWindowLevel(WindowLevel::AlwaysOnBottom),
SetWindowLevel(WindowLevel::Normal),
SetWindowLevel(WindowLevel::AlwaysOnTop),
Hide,
Search(Pattern::CurrentSelectionOrEmptyString),
PaneSelect(PaneSelectArguments {

View File

@ -32,10 +32,10 @@ use config::keyassignment::{
KeyAssignment, PaneDirection, Pattern, PromptInputLine, QuickSelectArguments,
RotationDirection, SpawnCommand, SplitSize,
};
use config::window::WindowLevel;
use config::{
configuration, AudibleBell, ConfigHandle, Dimension, DimensionContext, FrontEndSelection,
GeometryOrigin, GuiPosition, TermConfig, WindowCloseConfirmation,
window::WindowLevel
};
use lfucache::*;
use mlua::{FromLua, UserData, UserDataFields};
@ -2537,7 +2537,7 @@ impl TermWindow {
SetWindowLevel(level) => {
let window = self.window.clone().unwrap();
window.set_window_level(level.clone());
},
}
CopyTo(dest) => {
let text = self.selection_text(pane);
self.copy_to_clipboard(*dest, text);

View File

@ -1,6 +1,7 @@
use async_trait::async_trait;
use bitflags::bitflags;
use config::{ConfigHandle, window::WindowLevel, Dimension, GeometryOrigin};
use config::window::WindowLevel;
use config::{ConfigHandle, Dimension, GeometryOrigin};
use promise::Future;
use std::any::Any;
use std::path::PathBuf;
@ -71,7 +72,6 @@ pub enum MouseCursor {
SizeLeftRight,
}
/// Represents the preferred appearance of the windowing
/// environment.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]

View File

@ -26,7 +26,8 @@ use cocoa::foundation::{
NSArray, NSAutoreleasePool, NSFastEnumeration, NSInteger, NSNotFound, NSPoint, NSRect, NSSize,
NSUInteger,
};
use config::{ConfigHandle, window::WindowLevel};
use config::window::WindowLevel;
use config::ConfigHandle;
use core_foundation::base::{CFTypeID, TCFType};
use core_foundation::bundle::{CFBundleGetBundleWithIdentifier, CFBundleGetFunctionPointerForName};
use core_foundation::data::{CFData, CFDataGetBytePtr, CFDataRef};
@ -664,7 +665,6 @@ unsafe impl HasRawWindowHandle for Window {
}
}
pub type NSWindowLevel = i64;
pub fn nswindow_level_to_window_level(nswindow_level: NSWindowLevel) -> WindowLevel {
@ -680,7 +680,7 @@ pub fn window_level_to_nswindow_level(level: WindowLevel) -> NSWindowLevel {
match level {
WindowLevel::AlwaysOnBottom => -1,
WindowLevel::Normal => 0,
WindowLevel::AlwaysOnTop => 3
WindowLevel::AlwaysOnTop => 3,
}
}
@ -1098,7 +1098,6 @@ impl WindowInner {
/// @see https://developer.apple.com/documentation/appkit/nswindow/level
impl WindowInner {
fn show(&mut self) {
unsafe {
@ -1182,7 +1181,7 @@ impl WindowInner {
fn set_window_level(&mut self, level: WindowLevel) {
unsafe {
NSWindow::setLevel_(*self.window, window_level_to_nswindow_level(level));
WindowView::did_resize(&mut** self.view, sel!(windowDidResize:), nil);
WindowView::did_resize(&mut **self.view, sel!(windowDidResize:), nil);
}
}
@ -2789,10 +2788,14 @@ impl WindowView {
unsafe { msg_send![*window, isZoomed] }
});
let window_level = inner.window.as_ref().map(|window| {
let level = unsafe { window.load().level() };
nswindow_level_to_window_level(level)
}).unwrap_or_default();
let window_level = inner
.window
.as_ref()
.map(|window| {
let level = unsafe { window.load().level() };
nswindow_level_to_window_level(level)
})
.unwrap_or_default();
let level_state = match window_level {
WindowLevel::AlwaysOnBottom => WindowState::ALWAYS_ON_BOTTOM,