fix: format imports (#1431)

* fix: add nightly options

* style: format/sort imports
This commit is contained in:
Jakub Panek 2022-10-02 15:18:22 +02:00 committed by GitHub
parent 7b61e48b7d
commit 72a2d5e602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 391 additions and 415 deletions

View File

@ -1 +1,4 @@
max_width = 85
# below requires nightly
# imports_granularity = "Crate"
# group_imports = "StdExternalCrate"

View File

@ -1,9 +1,10 @@
use super::Buffer;
mod editing {
use xi_rope::Rope;
use super::*;
use crate::{editor::EditType, selection::Selection};
use xi_rope::Rope;
#[test]
fn is_pristine() {

View File

@ -1,10 +1,12 @@
use serde::{Deserialize, Serialize};
use xi_rope::{RopeDelta, Transformer};
use crate::buffer::Buffer;
use crate::mode::{Mode, MotionMode, VisualMode};
use crate::register::RegisterData;
use crate::selection::{InsertDrift, SelRegion, Selection};
use crate::{
buffer::Buffer,
mode::{Mode, MotionMode, VisualMode},
register::RegisterData,
selection::{InsertDrift, SelRegion, Selection},
};
#[derive(Clone, Copy, PartialEq, Debug, Serialize, Deserialize)]
pub enum ColPosition {

View File

@ -1384,10 +1384,12 @@ enum DuplicateDirection {
#[cfg(test)]
mod test {
use crate::buffer::Buffer;
use crate::cursor::{Cursor, CursorMode};
use crate::editor::{DuplicateDirection, Editor};
use crate::selection::{SelRegion, Selection};
use crate::{
buffer::Buffer,
cursor::{Cursor, CursorMode},
editor::{DuplicateDirection, Editor},
selection::{SelRegion, Selection},
};
#[test]
fn test_insert_simple() {

View File

@ -915,9 +915,10 @@ mod test {
// function(s) in the module become unused. Hence turning off the lints.
#![allow(unused, unreachable_code)]
use super::LapceLanguage;
use std::path::PathBuf;
use super::LapceLanguage;
fn assert_language(expected: LapceLanguage, exts: &[&str]) {
for ext in exts {
let path = PathBuf::from(&format!("a.{ext}"));

View File

@ -1,5 +1,6 @@
use serde::{Deserialize, Serialize};
use std::cmp::{max, min, Ordering};
use serde::{Deserialize, Serialize};
use xi_rope::{RopeDelta, Transformer};
use crate::cursor::ColPosition;
@ -534,9 +535,11 @@ fn remove_n_at<T>(v: &mut Vec<T>, index: usize, n: usize) {
#[cfg(test)]
mod test {
use crate::buffer::Buffer;
use crate::editor::EditType;
use crate::selection::{InsertDrift, SelRegion, Selection};
use crate::{
buffer::Buffer,
editor::EditType,
selection::{InsertDrift, SelRegion, Selection},
};
#[test]
fn should_return_selection_region_min() {

View File

@ -1,7 +1,6 @@
use std::str;
use lapce_rpc::style::{LineStyle, Style};
use xi_rope::{spans::Spans, LinesMetric, Rope};
pub const SCOPES: &[&str] = &[

View File

@ -20,9 +20,8 @@
};
use xi_rope::Rope;
use crate::{language::LapceLanguage, style::SCOPES};
use super::{util::RopeProvider, PARSER};
use crate::{language::LapceLanguage, style::SCOPES};
macro_rules! declare_language_highlights {
($($name:ident: $feature_name:expr),* $(,)?) => {

View File

@ -24,12 +24,6 @@
Interval, Rope, RopeDelta,
};
use crate::{
language::LapceLanguage,
lens::{Lens, LensBuilder},
style::SCOPES,
};
use self::{
edit::generate_edits,
highlight::{
@ -39,6 +33,11 @@
},
util::{matching_char, RopeProvider},
};
use crate::{
language::LapceLanguage,
lens::{Lens, LensBuilder},
style::SCOPES,
};
mod edit;
pub mod highlight;

View File

@ -420,8 +420,7 @@ fn classify_boundary(
prev: CharClassification,
next: CharClassification,
) -> WordBoundary {
use self::CharClassification::*;
use self::WordBoundary::*;
use self::{CharClassification::*, WordBoundary::*};
match (prev, next) {
(Lf, Lf) => Start,
(Lf, Space) => Interior,
@ -442,9 +441,10 @@ fn classify_boundary(
#[cfg(test)]
mod test {
use super::WordCursor;
use xi_rope::Rope;
use super::WordCursor;
#[test]
fn prev_boundary_should_be_none_at_position_zero() {
let rope = Rope::from("Hello world");

View File

@ -5,14 +5,20 @@
EventCtx, FileInfo, Point, Rect, Selector, SingleUse, Size, WidgetId, WindowId,
};
use indexmap::IndexMap;
use lapce_core::buffer::DiffLines;
use lapce_core::command::{
EditCommand, FocusCommand, MotionModeCommand, MoveCommand, MultiSelectionCommand,
use lapce_core::{
buffer::DiffLines,
command::{
EditCommand, FocusCommand, MotionModeCommand, MoveCommand,
MultiSelectionCommand,
},
syntax::Syntax,
};
use lapce_core::syntax::Syntax;
use lapce_rpc::plugin::{PluginId, VoltInfo, VoltMetadata};
use lapce_rpc::{
buffer::BufferId, file::FileNodeItem, source_control::DiffInfo, style::Style,
buffer::BufferId,
file::FileNodeItem,
plugin::{PluginId, VoltInfo, VoltMetadata},
source_control::DiffInfo,
style::Style,
terminal::TermId,
};
use lsp_types::{
@ -25,22 +31,23 @@
use strum_macros::{Display, EnumIter, EnumMessage, EnumString, IntoStaticStr};
use xi_rope::{spans::Spans, Rope};
use crate::alert::AlertContentData;
use crate::data::{LapceMainSplitData, LapceTabData, LapceWorkspace};
use crate::document::BufferContent;
use crate::editor::{EditorPosition, Line, LineCol};
use crate::menu::MenuKind;
use crate::rich_text::RichText;
use crate::selection_range::SelectionRangeDirection;
use crate::update::ReleaseInfo;
use crate::{
data::{EditorTabChild, SplitContent},
editor::EditorLocation,
alert::AlertContentData,
data::{
EditorTabChild, LapceMainSplitData, LapceTabData, LapceWorkspace,
SplitContent,
},
document::BufferContent,
editor::{EditorLocation, EditorPosition, Line, LineCol},
keypress::{KeyMap, KeyPress},
menu::MenuKind,
palette::{PaletteItem, PaletteType},
proxy::ProxyStatus,
rich_text::RichText,
search::Match,
selection_range::SelectionRangeDirection,
split::{SplitDirection, SplitMoveDirection},
update::ReleaseInfo,
};
pub const LAPCE_OPEN_FOLDER: Selector<FileInfo> = Selector::new("lapce.open-folder");

View File

@ -1,4 +1,4 @@
use std::{fmt::Display, path::PathBuf, sync::Arc};
use std::{fmt::Display, path::PathBuf, str::FromStr, sync::Arc};
use anyhow::Error;
use druid::{EventCtx, Size, WidgetId};
@ -8,7 +8,6 @@
use lapce_rpc::{buffer::BufferId, plugin::PluginId};
use lsp_types::{CompletionItem, CompletionResponse, Position};
use regex::Regex;
use std::str::FromStr;
use crate::{config::LapceConfig, list::ListData, proxy::LapceProxy};

View File

@ -1,4 +1,5 @@
use std::{
collections::HashMap,
io::Write,
path::{Path, PathBuf},
sync::Arc,
@ -9,11 +10,11 @@
Color, ExtEventSink, FontFamily, Size, Target,
};
use indexmap::IndexMap;
pub use lapce_proxy::APPLICATION_NAME;
use lapce_proxy::{directory::Directory, plugin::wasi::find_all_volts};
use once_cell::sync::Lazy;
use parking_lot::{Mutex, RwLock};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use structdesc::FieldNames;
use thiserror::Error;
use toml_edit::easy as toml;
@ -23,8 +24,6 @@
data::{LapceWorkspace, LapceWorkspaceType},
};
pub use lapce_proxy::APPLICATION_NAME;
pub const LOGO: &str = include_str!("../../extra/images/logo.svg");
const DEFAULT_SETTINGS: &str = include_str!("../../defaults/settings.toml");
const DEFAULT_LIGHT_THEME: &str = include_str!("../../defaults/light-theme.toml");

View File

@ -1,3 +1,5 @@
#[cfg(target_os = "windows")]
use std::env;
use std::{
cell::RefCell,
cmp::Ordering,
@ -10,16 +12,12 @@
time::Instant,
};
#[cfg(target_os = "windows")]
use std::env;
use anyhow::{anyhow, Result};
use crossbeam_channel::{unbounded, Receiver, Sender};
use druid::{
piet::PietText, theme, Command, Data, Env, EventCtx, ExtEventSink,
FileDialogOptions, Lens, Point, Rect, Size, Target, Vec2, WidgetId, WindowId,
};
use itertools::Itertools;
use lapce_core::{
command::{FocusCommand, MultiSelectionCommand},
@ -40,7 +38,6 @@
terminal::TermId,
RpcMessage,
};
use lsp_types::{Diagnostic, DiagnosticSeverity, Position, ProgressToken, TextEdit};
use notify::Watcher;
use serde::{Deserialize, Serialize};

View File

@ -9,7 +9,6 @@
use anyhow::{anyhow, Result};
use crossbeam_channel::{unbounded, Sender};
use druid::{ExtEventSink, Point, Rect, Size, Vec2, WidgetId};
use lapce_proxy::directory::Directory;
use serde::{Deserialize, Serialize};
use xi_rope::Rope;

View File

@ -44,7 +44,6 @@
Interval, Rope, RopeDelta, Transformer,
};
use crate::selection_range::SelectionRangeDirection;
use crate::{
command::{InitBufferContentCb, LapceUICommand, LAPCE_UI_COMMAND},
config::{LapceConfig, LapceTheme},
@ -53,7 +52,7 @@
find::{Find, FindProgress},
history::DocumentHistory,
proxy::LapceProxy,
selection_range::SyntaxSelectionRanges,
selection_range::{SelectionRangeDirection, SyntaxSelectionRanges},
settings::SettingsValueKind,
};

View File

@ -1,79 +1,62 @@
use crate::command::InitBufferContentCb;
use crate::command::LapceCommand;
use crate::command::LAPCE_COMMAND;
use crate::command::LAPCE_SAVE_FILE_AS;
use crate::command::{CommandExecuted, CommandKind};
use crate::completion::{CompletionData, CompletionStatus, Snippet};
use crate::config::LapceConfig;
use crate::data::EditorView;
use crate::data::FocusArea;
use crate::data::{
EditorDiagnostic, InlineFindDirection, LapceEditorData, LapceMainSplitData,
SplitContent,
use std::{
cmp::Ordering,
collections::HashMap,
iter::Iterator,
path::{Path, PathBuf},
str::FromStr,
sync::Arc,
thread,
time::Duration,
};
use crate::document::BufferContent;
use crate::document::Document;
use crate::document::LocalBufferKind;
use crate::hover::HoverData;
use crate::hover::HoverStatus;
use crate::keypress::KeyMap;
use crate::keypress::KeyPressFocus;
use crate::palette::PaletteData;
use crate::proxy::path_from_url;
use crate::rename::RenameData;
use crate::selection_range::SelectionRangeDirection;
use crate::{
command::{
EnsureVisiblePosition, InitBufferContent, LapceUICommand, LAPCE_UI_COMMAND,
},
split::SplitMoveDirection,
};
use crate::{find::Find, split::SplitDirection};
use crate::{proxy::LapceProxy, source_control::SourceControlData};
use anyhow::{anyhow, Result};
use crossbeam_channel::{self, bounded};
use druid::piet::PietTextLayout;
use druid::piet::Svg;
use druid::FileDialogOptions;
use druid::Modifiers;
use druid::{
piet::PietText, Command, Env, EventCtx, Point, Rect, Target, Vec2, WidgetId,
piet::{PietText, PietTextLayout, Svg},
Command, Env, EventCtx, ExtEventSink, FileDialogOptions, Modifiers, MouseEvent,
Point, Rect, Target, Vec2, WidgetId,
};
use druid::{ExtEventSink, MouseEvent};
use indexmap::IndexMap;
use lapce_core::buffer::Buffer;
use lapce_core::buffer::{DiffLines, InvalLines};
use lapce_core::command::{
EditCommand, FocusCommand, MotionModeCommand, MultiSelectionCommand,
};
use lapce_core::editor::EditType;
use lapce_core::mode::{Mode, MotionMode};
use lapce_core::selection::InsertDrift;
use lapce_core::selection::Selection;
pub use lapce_core::syntax::Syntax;
use lapce_rpc::proxy::ProxyResponse;
use lsp_types::request::GotoTypeDefinitionResponse;
use lsp_types::CodeActionOrCommand;
use lsp_types::CompletionTextEdit;
use lsp_types::DocumentChangeOperation;
use lsp_types::DocumentChanges;
use lsp_types::OneOf;
use lsp_types::ResourceOp;
use lsp_types::TextEdit;
use lsp_types::Url;
use lsp_types::WorkspaceEdit;
use lsp_types::{
CodeActionResponse, CompletionItem, DiagnosticSeverity, GotoDefinitionResponse,
Location, Position,
use lapce_core::{
buffer::{Buffer, DiffLines, InvalLines},
command::{EditCommand, FocusCommand, MotionModeCommand, MultiSelectionCommand},
editor::EditType,
mode::{Mode, MotionMode},
selection::{InsertDrift, Selection},
};
use lapce_rpc::proxy::ProxyResponse;
use lsp_types::{
request::GotoTypeDefinitionResponse, CodeActionOrCommand, CodeActionResponse,
CompletionItem, CompletionTextEdit, DiagnosticSeverity, DocumentChangeOperation,
DocumentChanges, GotoDefinitionResponse, Location, OneOf, Position, ResourceOp,
TextEdit, Url, WorkspaceEdit,
};
use xi_rope::{Rope, RopeDelta, Transformer};
use crate::{
command::{
CommandExecuted, CommandKind, EnsureVisiblePosition, InitBufferContent,
InitBufferContentCb, LapceCommand, LapceUICommand, LAPCE_COMMAND,
LAPCE_SAVE_FILE_AS, LAPCE_UI_COMMAND,
},
completion::{CompletionData, CompletionStatus, Snippet},
config::LapceConfig,
data::{
EditorDiagnostic, EditorView, FocusArea, InlineFindDirection,
LapceEditorData, LapceMainSplitData, SplitContent,
},
document::{BufferContent, Document, LocalBufferKind},
find::Find,
hover::{HoverData, HoverStatus},
keypress::{KeyMap, KeyPressFocus},
palette::PaletteData,
proxy::{path_from_url, LapceProxy},
rename::RenameData,
selection_range::SelectionRangeDirection,
source_control::SourceControlData,
split::{SplitDirection, SplitMoveDirection},
};
use std::cmp::Ordering;
use std::path::Path;
use std::thread;
use std::{collections::HashMap, sync::Arc};
use std::{iter::Iterator, path::PathBuf};
use std::{str::FromStr, time::Duration};
use xi_rope::Rope;
use xi_rope::{RopeDelta, Transformer};
pub struct LapceUI {}

View File

@ -1,25 +1,20 @@
use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc;
use std::{
collections::HashMap,
path::{Path, PathBuf},
sync::Arc,
};
use druid::Command;
use druid::EventCtx;
use druid::ExtEventSink;
use druid::{Target, WidgetId};
use lapce_core::cursor::CursorMode;
use lapce_core::selection::Selection;
use lapce_rpc::file::FileNodeItem;
use lapce_rpc::proxy::ProxyResponse;
use druid::{Command, EventCtx, ExtEventSink, Target, WidgetId};
use lapce_core::{cursor::CursorMode, selection::Selection};
use lapce_rpc::{file::FileNodeItem, proxy::ProxyResponse};
use xi_rope::Rope;
use crate::data::LapceMainSplitData;
use crate::data::LapceWorkspace;
use crate::document::LocalBufferKind;
use crate::proxy::LapceProxy;
use crate::{command::LapceUICommand, command::LAPCE_UI_COMMAND};
use crate::{
command::{LapceUICommand, LAPCE_UI_COMMAND},
data::{LapceMainSplitData, LapceWorkspace},
document::LocalBufferKind,
proxy::LapceProxy,
};
#[derive(Clone)]
pub enum Naming {

View File

@ -1,10 +1,11 @@
use std::cmp::{max, min};
use lapce_core::{
selection::{InsertDrift, SelRegion, Selection},
word::WordCursor,
};
use regex::{Regex, RegexBuilder};
use serde::{Deserialize, Serialize};
use std::cmp::{max, min};
use xi_rope::{
delta::DeltaRegion,
find::{find, is_multiline_regex, CaseMatching},

View File

@ -1,17 +1,14 @@
#![allow(clippy::module_inception)]
use std::path::PathBuf;
use std::sync::Arc;
use std::{path::PathBuf, sync::Arc};
use anyhow::Result;
use druid::piet::{PietTextLayout, Text, TextLayout, TextLayoutBuilder};
use druid::{Command, KbKey};
use druid::{
Env, EventCtx, ExtEventSink, KeyEvent, Modifiers, PaintCtx, Point, Rect,
RenderContext, Size, Target,
piet::{PietTextLayout, Text, TextLayout, TextLayoutBuilder},
Command, Env, EventCtx, ExtEventSink, KbKey, KeyEvent, Modifiers, PaintCtx,
Point, Rect, RenderContext, Size, Target,
};
use fuzzy_matcher::skim::SkimMatcherV2;
use fuzzy_matcher::FuzzyMatcher;
use fuzzy_matcher::{skim::SkimMatcherV2, FuzzyMatcher};
use indexmap::IndexMap;
use itertools::Itertools;
use lapce_core::mode::{Mode, Modes};
@ -19,14 +16,16 @@
mod keypress;
mod loader;
use crate::command::{
pub use keypress::KeyPress;
use crate::{
command::{
lapce_internal_commands, CommandExecuted, CommandKind, LapceCommand,
LapceUICommand, LAPCE_COMMAND, LAPCE_UI_COMMAND,
},
config::{LapceConfig, LapceTheme},
keypress::loader::KeyMapLoader,
};
use crate::config::{LapceConfig, LapceTheme};
use crate::keypress::loader::KeyMapLoader;
pub use keypress::KeyPress;
const DEFAULT_KEYMAPS_COMMON: &str =
include_str!("../../../defaults/keymaps-common.toml");
@ -740,9 +739,10 @@ fn parse_first(condition: &'a str) -> Self {
#[cfg(test)]
mod test {
use crate::keypress::{Condition, KeyPressData, KeyPressFocus};
use lapce_core::mode::Mode;
use crate::keypress::{Condition, KeyPressData, KeyPressFocus};
struct MockFocus {
accepted_conditions: &'static [&'static str],
}

View File

@ -1,38 +1,39 @@
use std::{cmp::Ordering, collections::HashSet, path::PathBuf, sync::Arc};
use alacritty_terminal::{grid::Dimensions, term::cell::Flags};
use anyhow::Result;
use crossbeam_channel::{unbounded, Receiver, Sender, TryRecvError};
use druid::{Command, ExtEventSink, Lens, Modifiers, Target, WidgetId};
use druid::{Data, Env, EventCtx};
use fuzzy_matcher::skim::SkimMatcherV2;
use fuzzy_matcher::FuzzyMatcher;
use druid::{
Command, Data, Env, EventCtx, ExtEventSink, Lens, Modifiers, Target, WidgetId,
};
use fuzzy_matcher::{skim::SkimMatcherV2, FuzzyMatcher};
use itertools::Itertools;
use lapce_core::command::{EditCommand, FocusCommand};
use lapce_core::language::LapceLanguage;
use lapce_core::mode::Mode;
use lapce_core::{
command::{EditCommand, FocusCommand},
language::LapceLanguage,
mode::Mode,
};
use lapce_rpc::proxy::ProxyResponse;
use lsp_types::{DocumentSymbolResponse, Position, Range, SymbolKind};
use std::cmp::Ordering;
use std::collections::HashSet;
use std::path::PathBuf;
use std::sync::Arc;
use uuid::Uuid;
use crate::command::CommandKind;
use crate::data::{LapceWorkspace, LapceWorkspaceType};
use crate::document::BufferContent;
use crate::editor::EditorLocation;
use crate::list::ListData;
use crate::panel::PanelKind;
use crate::proxy::path_from_url;
use crate::{
command::LAPCE_UI_COMMAND,
command::{CommandExecuted, LAPCE_COMMAND},
command::{LapceCommand, LapceUICommand},
command::{
CommandExecuted, CommandKind, LapceCommand, LapceUICommand, LAPCE_COMMAND,
LAPCE_UI_COMMAND,
},
config::LapceConfig,
data::{FocusArea, LapceMainSplitData, LapceTabData},
data::{
FocusArea, LapceMainSplitData, LapceTabData, LapceWorkspace,
LapceWorkspaceType,
},
document::BufferContent,
editor::EditorLocation,
find::Find,
keypress::{KeyPressData, KeyPressFocus},
proxy::LapceProxy,
list::ListData,
panel::PanelKind,
proxy::{path_from_url, LapceProxy},
terminal::TerminalSplitData,
};

View File

@ -8,9 +8,8 @@
use lapce_proxy::plugin::{download_volt, wasi::find_all_volts};
use lapce_rpc::plugin::{VoltInfo, VoltMetadata};
use lsp_types::Url;
use strum_macros::Display;
use plugin_install_status::PluginInstallStatus;
use strum_macros::Display;
use crate::{
command::{LapceUICommand, LAPCE_UI_COMMAND},

View File

@ -1,6 +1,6 @@
use std::{collections::HashMap, path::PathBuf};
use druid::WidgetId;
use std::collections::HashMap;
use std::path::PathBuf;
#[derive(Clone)]
pub struct ProblemData {

View File

@ -1,37 +1,39 @@
use std::io::BufReader;
#[cfg(target_os = "windows")]
use std::os::windows::process::CommandExt;
use std::path::Path;
use std::process::{Command, Stdio};
use std::thread;
use std::{collections::HashMap, io::Write};
use std::{path::PathBuf, str::FromStr, sync::Arc};
use std::{
collections::HashMap,
io::{BufReader, Write},
path::{Path, PathBuf},
process::{Command, Stdio},
str::FromStr,
sync::Arc,
thread,
};
use anyhow::{anyhow, Result};
use crossbeam_channel::Sender;
use druid::{ExtEventSink, WidgetId};
use druid::{Target, WindowId};
use druid::{ExtEventSink, Target, WidgetId, WindowId};
use flate2::read::GzDecoder;
use lapce_proxy::directory::Directory;
use lapce_proxy::dispatch::Dispatcher;
use lapce_proxy::APPLICATION_NAME;
pub use lapce_proxy::VERSION;
use lapce_rpc::core::{CoreHandler, CoreNotification, CoreRequest, CoreRpcHandler};
use lapce_rpc::proxy::{ProxyRpc, ProxyRpcHandler};
use lapce_rpc::stdio::stdio_transport;
use lapce_rpc::terminal::TermId;
use lapce_rpc::RequestId;
use lapce_rpc::RpcMessage;
use lapce_proxy::{directory::Directory, dispatch::Dispatcher, APPLICATION_NAME};
use lapce_rpc::{
core::{CoreHandler, CoreNotification, CoreRequest, CoreRpcHandler},
proxy::{ProxyRpc, ProxyRpcHandler},
stdio::stdio_transport,
terminal::TermId,
RequestId, RpcMessage,
};
use lsp_types::Url;
use parking_lot::Mutex;
use serde_json::Value;
use thiserror::Error;
use xi_rope::Rope;
use crate::command::LapceUICommand;
use crate::command::LAPCE_UI_COMMAND;
use crate::data::{LapceWorkspace, LapceWorkspaceType};
use crate::terminal::RawTerminal;
use crate::{
command::{LapceUICommand, LAPCE_UI_COMMAND},
data::{LapceWorkspace, LapceWorkspaceType},
terminal::RawTerminal,
};
const UNIX_PROXY_SCRIPT: &[u8] = include_bytes!("../../extra/proxy.sh");
const WINDOWS_PROXY_SCRIPT: &[u8] = include_bytes!("../../extra/proxy.ps1");

View File

@ -4,10 +4,10 @@
};
use druid::{
piet::TextStorage as PietTextStorage,
piet::{PietTextLayoutBuilder, TextLayoutBuilder},
text::{Attribute, AttributeSpans, Link},
text::{EnvUpdateCtx, TextStorage},
piet::{
PietTextLayoutBuilder, TextLayoutBuilder, TextStorage as PietTextStorage,
},
text::{Attribute, AttributeSpans, EnvUpdateCtx, Link, TextStorage},
ArcStr, Color, Command, Data, Env, FontDescriptor, FontFamily, FontStyle,
FontWeight, KeyOrValue,
};

View File

@ -93,10 +93,11 @@ fn count(&self) -> usize {
#[cfg(test)]
mod test {
use crate::selection_range::SyntaxSelectionRanges;
use lapce_rpc::buffer::BufferId;
use lsp_types::{Position, Range, SelectionRange};
use crate::selection_range::SyntaxSelectionRanges;
#[test]
fn should_get_next_selection_range() {
let range_zero = Range {

View File

@ -1,5 +1,4 @@
use lsp_types::ParameterLabel;
use lsp_types::SignatureHelp;
use lsp_types::{ParameterLabel, SignatureHelp};
#[derive(Clone)]
pub struct SignatureState {

View File

@ -1,14 +1,19 @@
use std::{
borrow::Cow,
ffi::OsString,
fs,
fs::File,
io::{Read, Write},
path::{Path, PathBuf},
time::SystemTime,
};
use anyhow::{anyhow, Result};
use lapce_core::buffer::rope_text::CharIndicesJoin;
use lapce_core::encoding::offset_utf8_to_utf16;
use lapce_core::{
buffer::rope_text::CharIndicesJoin, encoding::offset_utf8_to_utf16,
};
use lapce_rpc::buffer::BufferId;
use lsp_types::*;
use std::ffi::OsString;
use std::fs;
use std::fs::File;
use std::io::{Read, Write};
use std::path::PathBuf;
use std::{borrow::Cow, path::Path, time::SystemTime};
use xi_rope::{interval::IntervalBounds, rope::Rope, RopeDelta};
#[derive(Clone)]

View File

@ -1,38 +1,42 @@
use crate::buffer::{get_mod_time, load_file, Buffer};
use crate::plugin::catalog::PluginCatalog;
use crate::plugin::{remove_volt, PluginCatalogRpcHandler};
use crate::terminal::Terminal;
use crate::watcher::{FileWatcher, Notify, WatchToken};
use alacritty_terminal::event_loop::Msg;
use alacritty_terminal::term::SizeInfo;
use std::{
collections::{HashMap, HashSet},
fs,
path::{Path, PathBuf},
sync::Arc,
thread,
time::Duration,
};
use alacritty_terminal::{event_loop::Msg, term::SizeInfo};
use anyhow::{anyhow, Context, Result};
use crossbeam_channel::Sender;
use git2::build::CheckoutBuilder;
use git2::{DiffOptions, Repository};
use git2::{build::CheckoutBuilder, DiffOptions, Repository};
use grep_matcher::Matcher;
use grep_regex::RegexMatcherBuilder;
use grep_searcher::sinks::UTF8;
use grep_searcher::SearcherBuilder;
use lapce_rpc::core::{CoreNotification, CoreRpcHandler};
use lapce_rpc::file::FileNodeItem;
use lapce_rpc::proxy::{
ProxyHandler, ProxyNotification, ProxyRequest, ProxyResponse, ProxyRpcHandler,
use grep_searcher::{sinks::UTF8, SearcherBuilder};
use lapce_rpc::{
core::{CoreNotification, CoreRpcHandler},
file::FileNodeItem,
proxy::{
ProxyHandler, ProxyNotification, ProxyRequest, ProxyResponse,
ProxyRpcHandler,
},
source_control::{DiffInfo, FileDiff},
style::{LineStyle, SemanticStyles},
terminal::TermId,
RequestId, RpcError,
};
use lapce_rpc::source_control::{DiffInfo, FileDiff};
use lapce_rpc::style::{LineStyle, SemanticStyles};
use lapce_rpc::terminal::TermId;
use lapce_rpc::{RequestId, RpcError};
use lsp_types::{Position, Range, TextDocumentItem, Url};
use parking_lot::Mutex;
use std::collections::HashMap;
use std::collections::HashSet;
use std::fs;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::thread;
use std::time::Duration;
use xi_rope::Rope;
use crate::{
buffer::{get_mod_time, load_file, Buffer},
plugin::{catalog::PluginCatalog, remove_volt, PluginCatalogRpcHandler},
terminal::Terminal,
watcher::{FileWatcher, Notify, WatchToken},
};
const OPEN_FILE_EVENT_TOKEN: WatchToken = WatchToken(1);
const WORKSPACE_EVENT_TOKEN: WatchToken = WatchToken(2);

View File

@ -23,13 +23,12 @@
use serde_json::Value;
use xi_rope::{Rope, RopeDelta};
use crate::plugin::{install_volt, wasi::enable_volt};
use super::{
psp::{ClonableCallback, PluginServerRpc, PluginServerRpcHandler, RpcCallback},
wasi::{load_all_volts, start_volt},
PluginCatalogNotification, PluginCatalogRpcHandler,
};
use crate::plugin::{install_volt, wasi::enable_volt};
pub struct PluginCatalog {
workspace: Option<PathBuf>,

View File

@ -20,12 +20,11 @@
use serde_json::{json, Value};
use xi_rope::Rope;
use crate::{buffer::Buffer, plugin::PluginCatalogRpcHandler};
use super::psp::{
handle_plugin_server_message, PluginHandlerNotification, PluginHostHandler,
PluginServerHandler, PluginServerRpcHandler, RpcCallback,
};
use crate::{buffer::Buffer, plugin::PluginCatalogRpcHandler};
const HEADER_CONTENT_LENGTH: &str = "content-length";
const HEADER_CONTENT_TYPE: &str = "content-type";

View File

@ -3,22 +3,36 @@
pub mod psp;
pub mod wasi;
use std::{
collections::HashMap,
fs,
io::Write,
path::{Path, PathBuf},
sync::{
atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering},
Arc,
},
thread,
};
use anyhow::{anyhow, Result};
use crossbeam_channel::{Receiver, Sender};
use dyn_clone::DynClone;
use lapce_rpc::core::CoreRpcHandler;
use lapce_rpc::plugin::{PluginId, VoltInfo, VoltMetadata};
use lapce_rpc::proxy::ProxyRpcHandler;
use lapce_rpc::style::LineStyle;
use lapce_rpc::{RequestId, RpcError};
use lsp_types::request::{
use lapce_rpc::{
core::CoreRpcHandler,
plugin::{PluginId, VoltInfo, VoltMetadata},
proxy::ProxyRpcHandler,
style::LineStyle,
RequestId, RpcError,
};
use lsp_types::{
request::{
CodeActionRequest, Completion, DocumentSymbolRequest, Formatting,
GotoDefinition, GotoTypeDefinition, GotoTypeDefinitionParams,
GotoTypeDefinitionResponse, HoverRequest, InlayHintRequest,
PrepareRenameRequest, References, Rename, Request, ResolveCompletionItem,
SelectionRangeRequest, SemanticTokensFullRequest, WorkspaceSymbol,
};
use lsp_types::{
},
CodeActionContext, CodeActionParams, CodeActionResponse, CompletionItem,
CompletionParams, CompletionResponse, DocumentFormattingParams,
DocumentSymbolParams, DocumentSymbolResponse, FormattingOptions,
@ -31,24 +45,16 @@
WorkspaceSymbolParams,
};
use parking_lot::Mutex;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
use std::fs;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};
use std::sync::Arc;
use std::thread;
use xi_rope::{Rope, RopeDelta};
use crate::buffer::language_id_from_path;
use crate::directory::Directory;
use self::catalog::PluginCatalog;
use self::psp::{ClonableCallback, PluginServerRpcHandler, RpcCallback};
use self::wasi::{load_volt, start_volt};
use self::{
catalog::PluginCatalog,
psp::{ClonableCallback, PluginServerRpcHandler, RpcCallback},
wasi::{load_volt, start_volt},
};
use crate::{buffer::language_id_from_path, directory::Directory};
pub type PluginName = String;

View File

@ -27,8 +27,6 @@
use wasmtime_wasi::WasiCtxBuilder;
use xi_rope::{Rope, RopeDelta};
use crate::{directory::Directory, plugin::psp::PluginServerRpcHandler};
use super::{
psp::{
handle_plugin_server_message, PluginHandlerNotification, PluginHostHandler,
@ -36,6 +34,7 @@
},
PluginCatalogRpcHandler,
};
use crate::{directory::Directory, plugin::psp::PluginServerRpcHandler};
#[derive(Default)]
pub struct WasiPipe {

View File

@ -1,7 +1,3 @@
use crossbeam_channel::{Receiver, Sender};
use lsp_types::{CompletionResponse, ProgressParams, PublishDiagnosticsParams};
use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use std::{
collections::HashMap,
path::PathBuf,
@ -11,6 +7,11 @@
},
};
use crossbeam_channel::{Receiver, Sender};
use lsp_types::{CompletionResponse, ProgressParams, PublishDiagnosticsParams};
use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use crate::{
file::FileNodeItem,
plugin::{PluginId, VoltInfo, VoltMetadata},

View File

@ -10,12 +10,8 @@
pub mod style;
pub mod terminal;
pub use parse::Call;
pub use parse::RequestId;
pub use parse::RpcObject;
use serde::Deserialize;
use serde::Serialize;
pub use parse::{Call, RequestId, RpcObject};
use serde::{Deserialize, Serialize};
pub use stdio::stdio_transport;
#[derive(Debug)]

View File

@ -1,12 +1,13 @@
use anyhow::Result;
use crossbeam_channel::{Receiver, Sender};
use serde::{de::DeserializeOwned, Serialize};
use serde_json::{json, Value};
use std::{
io::{self, BufRead, Write},
thread,
};
use anyhow::Result;
use crossbeam_channel::{Receiver, Sender};
use serde::{de::DeserializeOwned, Serialize};
use serde_json::{json, Value};
use crate::{RpcError, RpcMessage, RpcObject};
pub fn stdio_transport<W, R, Req1, Notif1, Resp1, Req2, Notif2, Resp2>(

View File

@ -19,8 +19,11 @@
proxy::VERSION,
};
use crate::{logging::override_log_levels, tab::LAPCE_TAB_META};
use crate::{tab::LapceTabHeader, window::LapceWindow};
use crate::{
logging::override_log_levels,
tab::{LapceTabHeader, LAPCE_TAB_META},
window::LapceWindow,
};
#[derive(Parser)]
#[clap(name = "Lapce")]

View File

@ -1,4 +1,4 @@
use std::{fmt::Display, sync::Arc};
use std::{fmt::Display, str::FromStr, sync::Arc};
use anyhow::Error;
use druid::{
@ -20,7 +20,6 @@
};
use lsp_types::{Documentation, MarkupKind};
use regex::Regex;
use std::str::FromStr;
use crate::{
list::{List, ListPaint},

View File

@ -1,40 +1,35 @@
use std::collections::HashMap;
use std::time::Duration;
use std::{iter::Iterator, sync::Arc};
use std::{collections::HashMap, iter::Iterator, sync::Arc, time::Duration};
use druid::{
kurbo::{BezPath, Line},
piet::{PietText, PietTextLayout, Text, TextLayout as _, TextLayoutBuilder},
BoxConstraints, Color, Command, Env, Event, EventCtx, InternalLifeCycle,
LayoutCtx, LifeCycle, LifeCycleCtx, MouseButton, MouseEvent, PaintCtx, Point,
Rect, RenderContext, Size, Target, UpdateCtx, Widget, WidgetId,
LayoutCtx, LifeCycle, LifeCycleCtx, Modifiers, MouseButton, MouseEvent,
PaintCtx, Point, Rect, RenderContext, Size, Target, TimerToken, UpdateCtx,
Widget, WidgetId,
};
use druid::{Modifiers, TimerToken};
use lapce_core::buffer::DiffLines;
use lapce_core::command::EditCommand;
use lapce_core::{
command::FocusCommand,
buffer::DiffLines,
command::{EditCommand, FocusCommand},
cursor::{ColPosition, CursorMode},
mode::{Mode, VisualMode},
};
use lapce_data::command::CommandKind;
use lapce_data::data::{EditorView, LapceData};
use lapce_data::document::{BufferContent, LocalBufferKind};
use lapce_data::history::DocumentHistory;
use lapce_data::hover::HoverStatus;
use lapce_data::keypress::KeyPressFocus;
use lapce_data::menu::MenuKind;
use lapce_data::palette::PaletteStatus;
use lapce_data::panel::{PanelData, PanelKind};
use lapce_data::selection_range::SyntaxSelectionRanges;
use lapce_data::{
command::{
LapceCommand, LapceUICommand, LapceWorkbenchCommand, LAPCE_UI_COMMAND,
CommandKind, LapceCommand, LapceUICommand, LapceWorkbenchCommand,
LAPCE_UI_COMMAND,
},
config::{LapceConfig, LapceTheme},
data::LapceTabData,
data::{EditorView, LapceData, LapceTabData},
document::{BufferContent, LocalBufferKind},
editor::{LapceEditorBufferData, Syntax},
menu::MenuItem,
history::DocumentHistory,
hover::HoverStatus,
keypress::KeyPressFocus,
menu::{MenuItem, MenuKind},
palette::PaletteStatus,
panel::{PanelData, PanelKind},
selection_range::SyntaxSelectionRanges,
};
use lsp_types::{CodeActionOrCommand, DiagnosticSeverity};

View File

@ -5,13 +5,12 @@
};
use lapce_data::{config::LapceTheme, data::LapceTabData};
use super::bread_crumb::LapceEditorBreadCrumb;
use crate::{
editor::{gutter::LapceEditorGutter, LapceEditor},
scroll::{LapceIdentityWrapper, LapcePadding, LapceScroll},
};
use super::bread_crumb::LapceEditorBreadCrumb;
pub struct LapceEditorContainer {
pub view_id: WidgetId,
pub scroll_id: WidgetId,

View File

@ -1,4 +1,3 @@
use crate::svg::get_svg;
use druid::{
piet::{PietText, Text, TextLayout, TextLayoutBuilder},
BoxConstraints, Command, Env, Event, EventCtx, LayoutCtx, LifeCycle,
@ -13,6 +12,8 @@
editor::{LapceEditorBufferData, Syntax},
};
use crate::svg::get_svg;
pub struct LapceEditorGutter {
view_id: WidgetId,
width: f64,

View File

@ -21,12 +21,11 @@
split::{SplitDirection, SplitMoveDirection},
};
use crate::editor::{
tab_header::LapceEditorTabHeader, view::editor_tab_child_widget,
use crate::{
editor::{tab_header::LapceEditorTabHeader, view::editor_tab_child_widget},
svg::get_svg,
};
use crate::svg::get_svg;
pub struct LapceEditorTab {
pub widget_id: WidgetId,
header: WidgetPod<LapceTabData, LapceEditorTabHeader>,

View File

@ -1,34 +1,29 @@
use std::sync::Arc;
use std::{collections::HashMap, path::Path};
use std::{collections::HashMap, path::Path, sync::Arc};
use druid::menu::MenuEventCtx;
use druid::piet::TextAttribute;
use druid::{
piet::{Text, TextLayoutBuilder},
BoxConstraints, Command, Cursor, Env, Event, EventCtx, LayoutCtx, LifeCycle,
LifeCycleCtx, PaintCtx, Point, Rect, RenderContext, Size, Target, UpdateCtx,
Widget, WidgetExt, WidgetId, WidgetPod,
menu::MenuEventCtx,
piet::{Text, TextAttribute, TextLayoutBuilder},
BoxConstraints, Command, Cursor, Env, Event, EventCtx, ExtEventSink, KbKey,
LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx, Point, Rect, RenderContext, Size,
Target, UpdateCtx, Widget, WidgetExt, WidgetId, WidgetPod, WindowId,
};
use druid::{ExtEventSink, KbKey, WindowId};
use itertools::Itertools;
use lapce_core::command::FocusCommand;
use lapce_data::command::{CommandKind, LapceCommand, LAPCE_COMMAND};
use lapce_data::data::{EditorTabChild, LapceData, LapceEditorData};
use lapce_data::document::{BufferContent, LocalBufferKind};
use lapce_data::explorer::FileExplorerData;
use lapce_data::explorer::Naming;
use lapce_data::panel::PanelKind;
use lapce_data::proxy::{LapceProxy, VERSION};
use lapce_data::{
command::LapceUICommand,
command::LAPCE_UI_COMMAND,
command::{
CommandKind, LapceCommand, LapceUICommand, LAPCE_COMMAND, LAPCE_UI_COMMAND,
},
config::{LapceConfig, LapceTheme},
data::LapceTabData,
data::{EditorTabChild, LapceData, LapceEditorData, LapceTabData},
document::{BufferContent, LocalBufferKind},
explorer::{FileExplorerData, Naming},
panel::PanelKind,
proxy::{LapceProxy, VERSION},
};
use lapce_rpc::file::FileNodeItem;
use crate::editor::view::LapceEditorView;
use crate::{
editor::view::LapceEditorView,
panel::{LapcePanel, PanelHeaderKind, PanelSizing},
scroll::LapceScroll,
svg::{file_svg, get_svg},

View File

@ -1,32 +1,28 @@
use std::path::Path;
use std::sync::Arc;
use std::{path::Path, sync::Arc};
use druid::kurbo::Line;
use druid::piet::{Svg, TextAttribute, TextLayout};
use druid::{
kurbo::Rect,
piet::{Text, TextLayoutBuilder},
BoxConstraints, Command, Data, Env, Event, EventCtx, LayoutCtx, LifeCycle,
LifeCycleCtx, PaintCtx, Point, RenderContext, Size, Target, UpdateCtx, Widget,
WidgetExt, WidgetId, WidgetPod,
kurbo::{Line, Rect},
piet::{Svg, Text, TextAttribute, TextLayout, TextLayoutBuilder},
BoxConstraints, Command, Data, Env, Event, EventCtx, FontWeight, LayoutCtx,
LifeCycle, LifeCycleCtx, Modifiers, PaintCtx, Point, RenderContext, Size,
Target, UpdateCtx, Widget, WidgetExt, WidgetId, WidgetPod,
};
use druid::{FontWeight, Modifiers};
use lapce_data::command::LAPCE_COMMAND;
use lapce_data::data::LapceWorkspaceType;
use lapce_data::list::ListData;
use lapce_data::palette::{PaletteItem, PaletteItemContent, PaletteListData};
use lapce_data::{
command::{LapceUICommand, LAPCE_UI_COMMAND},
command::{LapceUICommand, LAPCE_COMMAND, LAPCE_UI_COMMAND},
config::LapceTheme,
data::LapceTabData,
data::{LapceTabData, LapceWorkspaceType},
keypress::KeyPressFocus,
palette::{PaletteStatus, PaletteType, PaletteViewData},
list::ListData,
palette::{
PaletteItem, PaletteItemContent, PaletteListData, PaletteStatus,
PaletteType, PaletteViewData,
},
};
use lsp_types::SymbolKind;
use crate::list::{List, ListPaint};
use crate::{
editor::view::LapceEditorView,
list::{List, ListPaint},
svg::{file_svg, symbol_svg},
};

View File

@ -1,8 +1,3 @@
use crate::{
panel::PanelSizing,
scroll::LapceScroll,
svg::{get_svg, logo_svg},
};
use druid::{
kurbo::Line,
piet::{
@ -27,7 +22,11 @@
rich_text::RichText,
};
use crate::panel::{LapcePanel, PanelHeaderKind};
use crate::{
panel::{LapcePanel, PanelHeaderKind, PanelSizing},
scroll::LapceScroll,
svg::{get_svg, logo_svg},
};
pub struct Plugin {
line_height: f64,

View File

@ -1,16 +1,11 @@
use std::time::Duration;
use std::time::Instant;
use std::time::{Duration, Instant};
use druid::Cursor;
use druid::{
kurbo::{Affine, Point, Rect, Size, Vec2},
Insets, WidgetId,
theme, BoxConstraints, Cursor, Data, Env, Event, EventCtx, Insets, LayoutCtx,
LifeCycle, LifeCycleCtx, PaintCtx, RenderContext, TimerToken, UpdateCtx, Widget,
WidgetId, WidgetPod,
};
use druid::{
theme, BoxConstraints, Data, Env, Event, EventCtx, LayoutCtx, LifeCycle,
LifeCycleCtx, PaintCtx, RenderContext, TimerToken, UpdateCtx, Widget, WidgetPod,
};
use lapce_data::{
command::{LapceUICommand, LAPCE_UI_COMMAND},
config::{GetConfig, LapceConfig, LapceTheme},

View File

@ -1,21 +1,11 @@
use crate::{
editor::{
tab::LapceEditorTab,
view::{editor_tab_child_widget, LapceEditorView},
},
terminal::LapceTerminalView,
};
use std::sync::Arc;
use crate::svg::logo_svg;
use druid::{
kurbo::{Line, Rect},
piet::{PietTextLayout, Text, TextLayout, TextLayoutBuilder},
Command, Target, WidgetId,
};
use druid::{
BoxConstraints, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx,
PaintCtx, Point, RenderContext, Size, UpdateCtx, Widget, WidgetExt, WidgetPod,
BoxConstraints, Command, Env, Event, EventCtx, LayoutCtx, LifeCycle,
LifeCycleCtx, PaintCtx, Point, RenderContext, Size, Target, UpdateCtx, Widget,
WidgetExt, WidgetId, WidgetPod,
};
use lapce_data::{
command::{
@ -31,6 +21,15 @@
};
use lapce_rpc::terminal::TermId;
use crate::{
editor::{
tab::LapceEditorTab,
view::{editor_tab_child_widget, LapceEditorView},
},
svg::logo_svg,
terminal::LapceTerminalView,
};
struct LapceDynamicSplit {
widget_id: WidgetId,
children: Vec<ChildWidget>,

View File

@ -2,11 +2,10 @@
use druid::{piet::Svg, Color};
use include_dir::{include_dir, Dir};
use lapce_data::config::{LapceConfig, LOGO};
use lsp_types::{CompletionItemKind, SymbolKind};
use once_cell::sync::Lazy;
use lapce_data::config::{LapceConfig, LOGO};
const ICONS_DIR: Dir = include_dir!("../icons");
static SVG_STORE: Lazy<SvgStore> = Lazy::new(SvgStore::new);

View File

@ -1,35 +1,31 @@
use std::sync::Arc;
use crate::list::List;
#[cfg(not(target_os = "macos"))]
use crate::window::window_controls;
use crate::{palette::Palette, svg::get_svg};
use druid::{kurbo::Circle, InternalEvent};
use druid::{
kurbo::Line,
kurbo::{Circle, Line},
piet::{PietText, PietTextLayout, Svg, Text, TextLayout, TextLayoutBuilder},
BoxConstraints, Color, Command, Env, Event, EventCtx, LayoutCtx, LifeCycle,
LifeCycleCtx, MouseEvent, PaintCtx, Point, Rect, Region, RenderContext, Size,
Target, Widget, WidgetExt, WidgetPod, WindowState,
BoxConstraints, Color, Command, Env, Event, EventCtx, InternalEvent, LayoutCtx,
LifeCycle, LifeCycleCtx, MouseEvent, PaintCtx, Point, Rect, Region,
RenderContext, Size, Target, Widget, WidgetExt, WidgetId, WidgetPod,
WindowConfig, WindowState,
};
use druid::{WidgetId, WindowConfig};
use lapce_core::command::FocusCommand;
use lapce_data::command::LAPCE_COMMAND;
use lapce_data::data::FocusArea;
use lapce_data::list::ListData;
use lapce_data::proxy::VERSION;
use lapce_data::{
command::{
CommandKind, LapceCommand, LapceUICommand, LapceWorkbenchCommand,
LAPCE_UI_COMMAND,
LAPCE_COMMAND, LAPCE_UI_COMMAND,
},
config::LapceTheme,
data::{LapceTabData, LapceWorkspaceType},
data::{FocusArea, LapceTabData, LapceWorkspaceType},
list::ListData,
menu::{MenuItem, MenuKind},
palette::PaletteStatus,
proxy::ProxyStatus,
proxy::{ProxyStatus, VERSION},
};
#[cfg(not(target_os = "macos"))]
use crate::window::window_controls;
use crate::{list::List, palette::Palette, svg::get_svg};
pub struct Title {
widget_id: WidgetId,
mouse_pos: Point,

View File

@ -1,3 +1,5 @@
use std::{cmp::Ordering, sync::Arc};
use druid::{
kurbo::Line,
widget::{LensWrap, WidgetExt},
@ -10,8 +12,6 @@
config::{LapceConfig, LapceTheme},
data::{LapceTabData, LapceTabLens, LapceWindowData, LapceWorkspace},
};
use std::cmp::Ordering;
use std::sync::Arc;
use crate::tab::{LapceTab, LapceTabHeader, LapceTabMeta, LAPCE_TAB_META};
@ -805,9 +805,10 @@ pub fn window_controls(
Vec<(Rect, Command)>,
Vec<(druid::piet::Svg, Rect, druid::Color)>,
) {
use crate::svg::get_svg;
use druid::Color;
use crate::svg::get_svg;
let mut commands = Vec::new();
let minimise_rect = Size::new(width, width)