Fix typos
This commit is contained in:
parent
46d2cbaa4c
commit
7c60f636d5
41 changed files with 69 additions and 72 deletions
|
@ -516,7 +516,7 @@
|
||||||
"terminal::SendText",
|
"terminal::SendText",
|
||||||
"\u0001"
|
"\u0001"
|
||||||
],
|
],
|
||||||
// Terminal.app compatability
|
// Terminal.app compatibility
|
||||||
"alt-left": [
|
"alt-left": [
|
||||||
"terminal::SendText",
|
"terminal::SendText",
|
||||||
"\u001bb"
|
"\u001bb"
|
||||||
|
|
|
@ -245,7 +245,7 @@
|
||||||
// copy to the system clipboard.
|
// copy to the system clipboard.
|
||||||
"copy_on_select": false,
|
"copy_on_select": false,
|
||||||
// Any key-value pairs added to this list will be added to the terminal's
|
// Any key-value pairs added to this list will be added to the terminal's
|
||||||
// enviroment. Use `:` to seperate multiple values.
|
// environment. Use `:` to separate multiple values.
|
||||||
"env": {
|
"env": {
|
||||||
// "KEY": "value1:value2"
|
// "KEY": "value1:value2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -159,10 +159,7 @@ impl Bundle {
|
||||||
fn path(&self) -> &Path {
|
fn path(&self) -> &Path {
|
||||||
match self {
|
match self {
|
||||||
Self::App { app_bundle, .. } => app_bundle,
|
Self::App { app_bundle, .. } => app_bundle,
|
||||||
Self::LocalPath {
|
Self::LocalPath { executable, .. } => executable,
|
||||||
executable: excutable,
|
|
||||||
..
|
|
||||||
} => excutable,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -472,7 +472,7 @@ impl CollabTitlebarItem {
|
||||||
Stack::new()
|
Stack::new()
|
||||||
.with_child(
|
.with_child(
|
||||||
MouseEventHandler::<ShareUnshare, Self>::new(0, cx, |state, _| {
|
MouseEventHandler::<ShareUnshare, Self>::new(0, cx, |state, _| {
|
||||||
//TODO: Ensure this button has consistant width for both text variations
|
//TODO: Ensure this button has consistent width for both text variations
|
||||||
let style = titlebar.share_button.style_for(state, false);
|
let style = titlebar.share_button.style_for(state, false);
|
||||||
Label::new(label, style.text.clone())
|
Label::new(label, style.text.clone())
|
||||||
.contained()
|
.contained()
|
||||||
|
|
|
@ -375,7 +375,7 @@ impl Copilot {
|
||||||
server
|
server
|
||||||
.on_notification::<LogMessage, _>(|params, _cx| {
|
.on_notification::<LogMessage, _>(|params, _cx| {
|
||||||
match params.level {
|
match params.level {
|
||||||
// Copilot is pretty agressive about logging
|
// Copilot is pretty aggressive about logging
|
||||||
0 => debug!("copilot: {}", params.message),
|
0 => debug!("copilot: {}", params.message),
|
||||||
1 => debug!("copilot: {}", params.message),
|
1 => debug!("copilot: {}", params.message),
|
||||||
_ => error!("copilot: {}", params.message),
|
_ => error!("copilot: {}", params.message),
|
||||||
|
|
|
@ -475,7 +475,7 @@ impl DisplaySnapshot {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator of the start positions of the occurances of `target` in the `self` after `from`
|
/// Returns an iterator of the start positions of the occurrences of `target` in the `self` after `from`
|
||||||
/// Stops if `condition` returns false for any of the character position pairs observed.
|
/// Stops if `condition` returns false for any of the character position pairs observed.
|
||||||
pub fn find_while<'a>(
|
pub fn find_while<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
|
@ -486,7 +486,7 @@ impl DisplaySnapshot {
|
||||||
Self::find_internal(self.chars_at(from), target.chars().collect(), condition)
|
Self::find_internal(self.chars_at(from), target.chars().collect(), condition)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator of the end positions of the occurances of `target` in the `self` before `from`
|
/// Returns an iterator of the end positions of the occurrences of `target` in the `self` before `from`
|
||||||
/// Stops if `condition` returns false for any of the character position pairs observed.
|
/// Stops if `condition` returns false for any of the character position pairs observed.
|
||||||
pub fn reverse_find_while<'a>(
|
pub fn reverse_find_while<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
|
|
|
@ -2539,7 +2539,7 @@ impl Editor {
|
||||||
.read(cx)
|
.read(cx)
|
||||||
.text_anchor_for_position(position.clone(), cx)?;
|
.text_anchor_for_position(position.clone(), cx)?;
|
||||||
|
|
||||||
// OnTypeFormatting retuns a list of edits, no need to pass them between Zed instances,
|
// OnTypeFormatting returns a list of edits, no need to pass them between Zed instances,
|
||||||
// hence we do LSP request & edit on host side only — add formats to host's history.
|
// hence we do LSP request & edit on host side only — add formats to host's history.
|
||||||
let push_to_lsp_host_history = true;
|
let push_to_lsp_host_history = true;
|
||||||
// If this is not the host, append its history with new edits.
|
// If this is not the host, append its history with new edits.
|
||||||
|
@ -7913,13 +7913,13 @@ pub fn diagnostic_block_renderer(diagnostic: Diagnostic, is_valid: bool) -> Rend
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn highlight_diagnostic_message(
|
pub fn highlight_diagnostic_message(
|
||||||
inital_highlights: Vec<usize>,
|
initial_highlights: Vec<usize>,
|
||||||
message: &str,
|
message: &str,
|
||||||
) -> (String, Vec<usize>) {
|
) -> (String, Vec<usize>) {
|
||||||
let mut message_without_backticks = String::new();
|
let mut message_without_backticks = String::new();
|
||||||
let mut prev_offset = 0;
|
let mut prev_offset = 0;
|
||||||
let mut inside_block = false;
|
let mut inside_block = false;
|
||||||
let mut highlights = inital_highlights;
|
let mut highlights = initial_highlights;
|
||||||
for (match_ix, (offset, _)) in message
|
for (match_ix, (offset, _)) in message
|
||||||
.match_indices('`')
|
.match_indices('`')
|
||||||
.chain([(message.len(), "")])
|
.chain([(message.len(), "")])
|
||||||
|
|
|
@ -4321,7 +4321,7 @@ async fn test_document_format_during_save(cx: &mut gpui::TestAppContext) {
|
||||||
);
|
);
|
||||||
assert!(!cx.read(|cx| editor.is_dirty(cx)));
|
assert!(!cx.read(|cx| editor.is_dirty(cx)));
|
||||||
|
|
||||||
// Set rust language override and assert overriden tabsize is sent to language server
|
// Set rust language override and assert overridden tabsize is sent to language server
|
||||||
update_test_settings(cx, |settings| {
|
update_test_settings(cx, |settings| {
|
||||||
settings.languages.insert(
|
settings.languages.insert(
|
||||||
"Rust".into(),
|
"Rust".into(),
|
||||||
|
@ -4435,7 +4435,7 @@ async fn test_range_format_during_save(cx: &mut gpui::TestAppContext) {
|
||||||
);
|
);
|
||||||
assert!(!cx.read(|cx| editor.is_dirty(cx)));
|
assert!(!cx.read(|cx| editor.is_dirty(cx)));
|
||||||
|
|
||||||
// Set rust language override and assert overriden tabsize is sent to language server
|
// Set rust language override and assert overridden tabsize is sent to language server
|
||||||
update_test_settings(cx, |settings| {
|
update_test_settings(cx, |settings| {
|
||||||
settings.languages.insert(
|
settings.languages.insert(
|
||||||
"Rust".into(),
|
"Rust".into(),
|
||||||
|
@ -4776,7 +4776,7 @@ async fn test_completion(cx: &mut gpui::TestAppContext) {
|
||||||
two
|
two
|
||||||
threeˇ
|
threeˇ
|
||||||
"},
|
"},
|
||||||
"overlapping aditional edit",
|
"overlapping additional edit",
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
|
@ -3080,7 +3080,7 @@ mod tests {
|
||||||
editor_width: f32,
|
editor_width: f32,
|
||||||
) -> Vec<Invisible> {
|
) -> Vec<Invisible> {
|
||||||
info!(
|
info!(
|
||||||
"Creating editor with mode {editor_mode:?}, witdh {editor_width} and text '{input_text}'"
|
"Creating editor with mode {editor_mode:?}, width {editor_width} and text '{input_text}'"
|
||||||
);
|
);
|
||||||
let (_, editor) = cx.add_window(|cx| {
|
let (_, editor) = cx.add_window(|cx| {
|
||||||
let buffer = MultiBuffer::build_simple(&input_text, cx);
|
let buffer = MultiBuffer::build_simple(&input_text, cx);
|
||||||
|
|
|
@ -5332,7 +5332,7 @@ mod tests {
|
||||||
assert_eq!(multibuffer.read(cx).text(), "ABCDE1234\nAB5678");
|
assert_eq!(multibuffer.read(cx).text(), "ABCDE1234\nAB5678");
|
||||||
|
|
||||||
// An undo in the multibuffer undoes the multibuffer transaction
|
// An undo in the multibuffer undoes the multibuffer transaction
|
||||||
// and also any individual buffer edits that have occured since
|
// and also any individual buffer edits that have occurred since
|
||||||
// that transaction.
|
// that transaction.
|
||||||
multibuffer.undo(cx);
|
multibuffer.undo(cx);
|
||||||
assert_eq!(multibuffer.read(cx).text(), "AB1234\nAB5678");
|
assert_eq!(multibuffer.read(cx).text(), "AB1234\nAB5678");
|
||||||
|
|
|
@ -48,8 +48,8 @@ pub fn marked_display_snapshot(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn select_ranges(editor: &mut Editor, marked_text: &str, cx: &mut ViewContext<Editor>) {
|
pub fn select_ranges(editor: &mut Editor, marked_text: &str, cx: &mut ViewContext<Editor>) {
|
||||||
let (umarked_text, text_ranges) = marked_text_ranges(marked_text, true);
|
let (unmarked_text, text_ranges) = marked_text_ranges(marked_text, true);
|
||||||
assert_eq!(editor.text(cx), umarked_text);
|
assert_eq!(editor.text(cx), unmarked_text);
|
||||||
editor.change_selections(None, cx, |s| s.select_ranges(text_ranges));
|
editor.change_selections(None, cx, |s| s.select_ranges(text_ranges));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ use repository::{FakeGitRepositoryState, GitFileStatus};
|
||||||
use std::sync::Weak;
|
use std::sync::Weak;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref LINE_SEPERATORS_REGEX: Regex = Regex::new("\r\n|\r|\u{2028}|\u{2029}").unwrap();
|
static ref LINE_SEPARATORS_REGEX: Regex = Regex::new("\r\n|\r|\u{2028}|\u{2029}").unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||||
|
@ -77,13 +77,13 @@ impl LineEnding {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn normalize(text: &mut String) {
|
pub fn normalize(text: &mut String) {
|
||||||
if let Cow::Owned(replaced) = LINE_SEPERATORS_REGEX.replace_all(text, "\n") {
|
if let Cow::Owned(replaced) = LINE_SEPARATORS_REGEX.replace_all(text, "\n") {
|
||||||
*text = replaced;
|
*text = replaced;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn normalize_arc(text: Arc<str>) -> Arc<str> {
|
pub fn normalize_arc(text: Arc<str>) -> Arc<str> {
|
||||||
if let Cow::Owned(replaced) = LINE_SEPERATORS_REGEX.replace_all(&text, "\n") {
|
if let Cow::Owned(replaced) = LINE_SEPARATORS_REGEX.replace_all(&text, "\n") {
|
||||||
replaced.into()
|
replaced.into()
|
||||||
} else {
|
} else {
|
||||||
text
|
text
|
||||||
|
|
|
@ -6335,9 +6335,9 @@ mod tests {
|
||||||
#[crate::test(self)]
|
#[crate::test(self)]
|
||||||
async fn test_labeled_tasks(cx: &mut TestAppContext) {
|
async fn test_labeled_tasks(cx: &mut TestAppContext) {
|
||||||
assert_eq!(None, cx.update(|cx| cx.active_labeled_tasks().next()));
|
assert_eq!(None, cx.update(|cx| cx.active_labeled_tasks().next()));
|
||||||
let (mut sender, mut reciever) = postage::oneshot::channel::<()>();
|
let (mut sender, mut receiver) = postage::oneshot::channel::<()>();
|
||||||
let task = cx
|
let task = cx
|
||||||
.update(|cx| cx.spawn_labeled("Test Label", |_| async move { reciever.recv().await }));
|
.update(|cx| cx.spawn_labeled("Test Label", |_| async move { receiver.recv().await }));
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Some("Test Label"),
|
Some("Test Label"),
|
||||||
|
|
|
@ -67,7 +67,7 @@ impl KeymapMatcher {
|
||||||
/// MatchResult::Pending =>
|
/// MatchResult::Pending =>
|
||||||
/// There exist bindings which are still waiting for more keys.
|
/// There exist bindings which are still waiting for more keys.
|
||||||
/// MatchResult::Complete(matches) =>
|
/// MatchResult::Complete(matches) =>
|
||||||
/// 1 or more bindings have recieved the necessary key presses.
|
/// 1 or more bindings have received the necessary key presses.
|
||||||
/// The order of the matched actions is by position of the matching first,
|
/// The order of the matched actions is by position of the matching first,
|
||||||
// and order in the keymap second.
|
// and order in the keymap second.
|
||||||
pub fn push_keystroke(
|
pub fn push_keystroke(
|
||||||
|
|
|
@ -264,7 +264,7 @@ impl settings::Setting for AllLanguageSettings {
|
||||||
let mut root_schema = generator.root_schema_for::<Self::FileContent>();
|
let mut root_schema = generator.root_schema_for::<Self::FileContent>();
|
||||||
|
|
||||||
// Create a schema for a 'languages overrides' object, associating editor
|
// Create a schema for a 'languages overrides' object, associating editor
|
||||||
// settings with specific langauges.
|
// settings with specific languages.
|
||||||
assert!(root_schema
|
assert!(root_schema
|
||||||
.definitions
|
.definitions
|
||||||
.contains_key("LanguageSettingsContent"));
|
.contains_key("LanguageSettingsContent"));
|
||||||
|
|
|
@ -773,7 +773,7 @@ impl<'a> SyntaxMapCaptures<'a> {
|
||||||
} in layers
|
} in layers
|
||||||
{
|
{
|
||||||
let grammar = match &language.grammar {
|
let grammar = match &language.grammar {
|
||||||
Some(grammer) => grammer,
|
Some(grammar) => grammar,
|
||||||
None => continue,
|
None => continue,
|
||||||
};
|
};
|
||||||
let query = match query(&grammar) {
|
let query = match query(&grammar) {
|
||||||
|
@ -896,7 +896,7 @@ impl<'a> SyntaxMapMatches<'a> {
|
||||||
} in layers
|
} in layers
|
||||||
{
|
{
|
||||||
let grammar = match &language.grammar {
|
let grammar = match &language.grammar {
|
||||||
Some(grammer) => grammer,
|
Some(grammar) => grammar,
|
||||||
None => continue,
|
None => continue,
|
||||||
};
|
};
|
||||||
let query = match query(&grammar) {
|
let query = match query(&grammar) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ use syn::{parse_macro_input, Block, FnArg, ForeignItemFn, Ident, ItemFn, Pat, Ty
|
||||||
/// "Hello from Wasm".into()
|
/// "Hello from Wasm".into()
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
/// This macro makes a function defined guest-side avaliable host-side.
|
/// This macro makes a function defined guest-side available host-side.
|
||||||
/// Note that all arguments and return types must be `serde`.
|
/// Note that all arguments and return types must be `serde`.
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn export(args: TokenStream, function: TokenStream) -> TokenStream {
|
pub fn export(args: TokenStream, function: TokenStream) -> TokenStream {
|
||||||
|
@ -92,7 +92,7 @@ pub fn export(args: TokenStream, function: TokenStream) -> TokenStream {
|
||||||
/// #[import]
|
/// #[import]
|
||||||
/// pub fn operating_system_name() -> String;
|
/// pub fn operating_system_name() -> String;
|
||||||
/// ```
|
/// ```
|
||||||
/// This macro makes a function defined host-side avaliable guest-side.
|
/// This macro makes a function defined host-side available guest-side.
|
||||||
/// Note that all arguments and return types must be `serde`.
|
/// Note that all arguments and return types must be `serde`.
|
||||||
/// All that's provided is a signature, as the function is implemented host-side.
|
/// All that's provided is a signature, as the function is implemented host-side.
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
|
|
|
@ -127,7 +127,7 @@ use plugin_handles::RopeHandle;
|
||||||
pub fn append(rope: RopeHandle, string: &str);
|
pub fn append(rope: RopeHandle, string: &str);
|
||||||
```
|
```
|
||||||
|
|
||||||
This allows us to perform an operation on a `Rope`, but how do we get a `RopeHandle` into a plugin? Well, as plugins, we can only aquire resources to handles we're given, so we'd need to expose a fuction that takes a handle.
|
This allows us to perform an operation on a `Rope`, but how do we get a `RopeHandle` into a plugin? Well, as plugins, we can only acquire resources to handles we're given, so we'd need to expose a function that takes a handle.
|
||||||
|
|
||||||
To illustrate that point, here's an example. First, we'd define a plugin-side function as follows:
|
To illustrate that point, here's an example. First, we'd define a plugin-side function as follows:
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ So here's what calling `append_newline` would do, from the top:
|
||||||
|
|
||||||
6. And from here on out we return up the callstack, through Wasm, to Rust all the way back to where we started. Right before we return, we clear out the `ResourcePool`, so that we're no longer holding onto the underlying resource.
|
6. And from here on out we return up the callstack, through Wasm, to Rust all the way back to where we started. Right before we return, we clear out the `ResourcePool`, so that we're no longer holding onto the underlying resource.
|
||||||
|
|
||||||
Throughout this entire chain of calls, the resource remain host-side. By temporarilty checking it into a `ResourcePool`, we're able to keep a reference to the resource that we can use, while avoiding copying the uncopyable resource.
|
Throughout this entire chain of calls, the resource remain host-side. By temporarily checking it into a `ResourcePool`, we're able to keep a reference to the resource that we can use, while avoiding copying the uncopyable resource.
|
||||||
|
|
||||||
## Final Notes
|
## Final Notes
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ impl PluginBuilder {
|
||||||
"env",
|
"env",
|
||||||
&format!("__{}", name),
|
&format!("__{}", name),
|
||||||
move |mut caller: Caller<'_, WasiCtxAlloc>, packed_buffer: u64| {
|
move |mut caller: Caller<'_, WasiCtxAlloc>, packed_buffer: u64| {
|
||||||
// TODO: use try block once avaliable
|
// TODO: use try block once available
|
||||||
let result: Result<(WasiBuffer, Memory, _), Trap> = (|| {
|
let result: Result<(WasiBuffer, Memory, _), Trap> = (|| {
|
||||||
// grab a handle to the memory
|
// grab a handle to the memory
|
||||||
let plugin_memory = match caller.get_export("memory") {
|
let plugin_memory = match caller.get_export("memory") {
|
||||||
|
@ -211,7 +211,7 @@ impl PluginBuilder {
|
||||||
"env",
|
"env",
|
||||||
&format!("__{}", name),
|
&format!("__{}", name),
|
||||||
move |mut caller: Caller<'_, WasiCtxAlloc>, packed_buffer: u64| {
|
move |mut caller: Caller<'_, WasiCtxAlloc>, packed_buffer: u64| {
|
||||||
// TODO: use try block once avaliable
|
// TODO: use try block once available
|
||||||
let result: Result<(WasiBuffer, Memory, Vec<u8>), Trap> = (|| {
|
let result: Result<(WasiBuffer, Memory, Vec<u8>), Trap> = (|| {
|
||||||
// grab a handle to the memory
|
// grab a handle to the memory
|
||||||
let plugin_memory = match caller.get_export("memory") {
|
let plugin_memory = match caller.get_export("memory") {
|
||||||
|
@ -297,7 +297,7 @@ pub enum PluginBinary<'a> {
|
||||||
Precompiled(&'a [u8]),
|
Precompiled(&'a [u8]),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents a WebAssembly plugin, with access to the WebAssembly System Inferface.
|
/// Represents a WebAssembly plugin, with access to the WebAssembly System Interface.
|
||||||
/// Build a new plugin using [`PluginBuilder`].
|
/// Build a new plugin using [`PluginBuilder`].
|
||||||
pub struct Plugin {
|
pub struct Plugin {
|
||||||
store: Store<WasiCtxAlloc>,
|
store: Store<WasiCtxAlloc>,
|
||||||
|
@ -559,7 +559,7 @@ impl Plugin {
|
||||||
.ok_or_else(|| anyhow!("Could not grab slice of plugin memory"))?;
|
.ok_or_else(|| anyhow!("Could not grab slice of plugin memory"))?;
|
||||||
|
|
||||||
// write the argument to linear memory
|
// write the argument to linear memory
|
||||||
// this returns a (ptr, lentgh) pair
|
// this returns a (ptr, length) pair
|
||||||
let arg_buffer = Self::bytes_to_buffer(
|
let arg_buffer = Self::bytes_to_buffer(
|
||||||
self.store.data().alloc_buffer(),
|
self.store.data().alloc_buffer(),
|
||||||
&mut plugin_memory,
|
&mut plugin_memory,
|
||||||
|
@ -569,7 +569,7 @@ impl Plugin {
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// call the function, passing in the buffer and its length
|
// call the function, passing in the buffer and its length
|
||||||
// this returns a ptr to a (ptr, lentgh) pair
|
// this returns a ptr to a (ptr, length) pair
|
||||||
let result_buffer = handle
|
let result_buffer = handle
|
||||||
.function
|
.function
|
||||||
.call_async(&mut self.store, arg_buffer.into_u64())
|
.call_async(&mut self.store, arg_buffer.into_u64())
|
||||||
|
|
|
@ -4052,7 +4052,7 @@ impl Project {
|
||||||
let end_within = range.start.cmp(&primary.end, buffer).is_le()
|
let end_within = range.start.cmp(&primary.end, buffer).is_le()
|
||||||
&& range.end.cmp(&primary.end, buffer).is_ge();
|
&& range.end.cmp(&primary.end, buffer).is_ge();
|
||||||
|
|
||||||
//Skip addtional edits which overlap with the primary completion edit
|
//Skip additional edits which overlap with the primary completion edit
|
||||||
//https://github.com/zed-industries/zed/pull/1871
|
//https://github.com/zed-industries/zed/pull/1871
|
||||||
if !start_within && !end_within {
|
if !start_within && !end_within {
|
||||||
buffer.edit([(range, text)], None, cx);
|
buffer.edit([(range, text)], None, cx);
|
||||||
|
|
|
@ -157,7 +157,7 @@ impl RepositoryEntry {
|
||||||
self.statuses
|
self.statuses
|
||||||
.iter_from(&repo_path)
|
.iter_from(&repo_path)
|
||||||
.take_while(|(key, _)| key.starts_with(&repo_path))
|
.take_while(|(key, _)| key.starts_with(&repo_path))
|
||||||
// Short circut once we've found the highest level
|
// Short circuit once we've found the highest level
|
||||||
.take_until(|(_, status)| status == &&GitFileStatus::Conflict)
|
.take_until(|(_, status)| status == &&GitFileStatus::Conflict)
|
||||||
.map(|(_, status)| status)
|
.map(|(_, status)| status)
|
||||||
.reduce(
|
.reduce(
|
||||||
|
@ -3623,7 +3623,7 @@ pub trait WorktreeHandle {
|
||||||
|
|
||||||
impl WorktreeHandle for ModelHandle<Worktree> {
|
impl WorktreeHandle for ModelHandle<Worktree> {
|
||||||
// When the worktree's FS event stream sometimes delivers "redundant" events for FS changes that
|
// When the worktree's FS event stream sometimes delivers "redundant" events for FS changes that
|
||||||
// occurred before the worktree was constructed. These events can cause the worktree to perfrom
|
// occurred before the worktree was constructed. These events can cause the worktree to perform
|
||||||
// extra directory scans, and emit extra scan-state notifications.
|
// extra directory scans, and emit extra scan-state notifications.
|
||||||
//
|
//
|
||||||
// This function mutates the worktree's directory and waits for those mutations to be picked up,
|
// This function mutates the worktree's directory and waits for those mutations to be picked up,
|
||||||
|
|
|
@ -276,7 +276,7 @@ mod tests {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Set up fake langauge server to return fuzzy matches against
|
// Set up fake language server to return fuzzy matches against
|
||||||
// a fixed set of symbol names.
|
// a fixed set of symbol names.
|
||||||
let fake_symbols = [
|
let fake_symbols = [
|
||||||
symbol("one", "/external"),
|
symbol("one", "/external"),
|
||||||
|
|
|
@ -476,7 +476,7 @@ message Symbol {
|
||||||
string name = 4;
|
string name = 4;
|
||||||
int32 kind = 5;
|
int32 kind = 5;
|
||||||
string path = 6;
|
string path = 6;
|
||||||
// Cannot use generate anchors for unopend files,
|
// Cannot use generate anchors for unopened files,
|
||||||
// so we are forced to use point coords instead
|
// so we are forced to use point coords instead
|
||||||
PointUtf16 start = 7;
|
PointUtf16 start = 7;
|
||||||
PointUtf16 end = 8;
|
PointUtf16 end = 8;
|
||||||
|
|
|
@ -42,7 +42,7 @@ impl PublicKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PrivateKey {
|
impl PrivateKey {
|
||||||
/// Decrypt a base64-encoded string that was encrypted by the correspoding public key.
|
/// Decrypt a base64-encoded string that was encrypted by the corresponding public key.
|
||||||
pub fn decrypt_string(&self, encrypted_string: &str) -> Result<String> {
|
pub fn decrypt_string(&self, encrypted_string: &str) -> Result<String> {
|
||||||
let encrypted_bytes = base64::decode_config(encrypted_string, base64::URL_SAFE)
|
let encrypted_bytes = base64::decode_config(encrypted_string, base64::URL_SAFE)
|
||||||
.context("failed to base64-decode encrypted string")?;
|
.context("failed to base64-decode encrypted string")?;
|
||||||
|
|
|
@ -160,7 +160,7 @@ impl<M: Migrator> ThreadSafeConnection<M> {
|
||||||
|
|
||||||
// Create a one shot channel for the result of the queued write
|
// Create a one shot channel for the result of the queued write
|
||||||
// so we can await on the result
|
// so we can await on the result
|
||||||
let (sender, reciever) = oneshot::channel();
|
let (sender, receiver) = oneshot::channel();
|
||||||
|
|
||||||
let thread_safe_connection = (*self).clone();
|
let thread_safe_connection = (*self).clone();
|
||||||
write_channel(Box::new(move || {
|
write_channel(Box::new(move || {
|
||||||
|
@ -168,7 +168,7 @@ impl<M: Migrator> ThreadSafeConnection<M> {
|
||||||
let result = connection.with_write(|connection| callback(connection));
|
let result = connection.with_write(|connection| callback(connection));
|
||||||
sender.send(result).ok();
|
sender.send(result).ok();
|
||||||
}));
|
}));
|
||||||
reciever.map(|response| response.expect("Write queue unexpectedly closed"))
|
receiver.map(|response| response.expect("Write queue unexpectedly closed"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn create_connection(
|
pub(crate) fn create_connection(
|
||||||
|
@ -245,10 +245,10 @@ pub fn background_thread_queue() -> WriteQueueConstructor {
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
|
||||||
Box::new(|| {
|
Box::new(|| {
|
||||||
let (sender, reciever) = channel::<QueuedWrite>();
|
let (sender, receiver) = channel::<QueuedWrite>();
|
||||||
|
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
while let Ok(write) = reciever.recv() {
|
while let Ok(write) = receiver.recv() {
|
||||||
write()
|
write()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub fn convert_color(alac_color: &AnsiColor, style: &TerminalStyle) -> Color {
|
||||||
}
|
}
|
||||||
|
|
||||||
///Converts an 8 bit ANSI color to it's GPUI equivalent.
|
///Converts an 8 bit ANSI color to it's GPUI equivalent.
|
||||||
///Accepts usize for compatability with the alacritty::Colors interface,
|
///Accepts usize for compatibility with the alacritty::Colors interface,
|
||||||
///Other than that use case, should only be called with values in the [0,255] range
|
///Other than that use case, should only be called with values in the [0,255] range
|
||||||
pub fn get_color_at_index(index: &usize, style: &TerminalStyle) -> Color {
|
pub fn get_color_at_index(index: &usize, style: &TerminalStyle) -> Color {
|
||||||
match index {
|
match index {
|
||||||
|
@ -78,7 +78,7 @@ pub fn get_color_at_index(index: &usize, style: &TerminalStyle) -> Color {
|
||||||
let step = (u8::MAX as f32 / 24.).floor() as u8; //Split the RGB grayscale values into 24 chunks
|
let step = (u8::MAX as f32 / 24.).floor() as u8; //Split the RGB grayscale values into 24 chunks
|
||||||
Color::new(i * step, i * step, i * step, u8::MAX) //Map the ANSI-grayscale components to the RGB-grayscale
|
Color::new(i * step, i * step, i * step, u8::MAX) //Map the ANSI-grayscale components to the RGB-grayscale
|
||||||
}
|
}
|
||||||
//For compatability with the alacritty::Colors interface
|
//For compatibility with the alacritty::Colors interface
|
||||||
256 => style.foreground,
|
256 => style.foreground,
|
||||||
257 => style.background,
|
257 => style.background,
|
||||||
258 => style.cursor,
|
258 => style.cursor,
|
||||||
|
|
|
@ -18,6 +18,6 @@ There are currently many distinct paths for getting keystrokes to the terminal:
|
||||||
|
|
||||||
3. IME text. When the special character mappings fail, we pass the keystroke back to GPUI to hand it to the IME system. This comes back to us in the `View::replace_text_in_range()` method, and we then send that to the terminal directly, bypassing `try_keystroke()`.
|
3. IME text. When the special character mappings fail, we pass the keystroke back to GPUI to hand it to the IME system. This comes back to us in the `View::replace_text_in_range()` method, and we then send that to the terminal directly, bypassing `try_keystroke()`.
|
||||||
|
|
||||||
4. Pasted text has a seperate pathway.
|
4. Pasted text has a separate pathway.
|
||||||
|
|
||||||
Generally, there's a distinction between 'keystrokes that need to be mapped' and 'strings which need to be written'. I've attempted to unify these under the '.try_keystroke()' API and the `.input()` API (which try_keystroke uses) so we have consistent input handling across the terminal
|
Generally, there's a distinction between 'keystrokes that need to be mapped' and 'strings which need to be written'. I've attempted to unify these under the '.try_keystroke()' API and the `.input()` API (which try_keystroke uses) so we have consistent input handling across the terminal
|
|
@ -40,7 +40,7 @@ function contrast_colour {
|
||||||
|
|
||||||
# Uncomment the below for more precise luminance calculations
|
# Uncomment the below for more precise luminance calculations
|
||||||
|
|
||||||
# # Calculate percieved brightness
|
# # Calculate perceived brightness
|
||||||
# # See https://www.w3.org/TR/AERT#color-contrast
|
# # See https://www.w3.org/TR/AERT#color-contrast
|
||||||
# # and http://www.itu.int/rec/R-REC-BT.601
|
# # and http://www.itu.int/rec/R-REC-BT.601
|
||||||
# # Luminance is in range 0..5000 as each value is 0..5
|
# # Luminance is in range 0..5000 as each value is 0..5
|
||||||
|
|
|
@ -34,7 +34,7 @@ use std::{mem, ops::Range};
|
||||||
|
|
||||||
use crate::TerminalView;
|
use crate::TerminalView;
|
||||||
|
|
||||||
///The information generated during layout that is nescessary for painting
|
///The information generated during layout that is necessary for painting
|
||||||
pub struct LayoutState {
|
pub struct LayoutState {
|
||||||
cells: Vec<LayoutCell>,
|
cells: Vec<LayoutCell>,
|
||||||
rects: Vec<LayoutRect>,
|
rects: Vec<LayoutRect>,
|
||||||
|
@ -206,7 +206,7 @@ impl TerminalElement {
|
||||||
//Expand background rect range
|
//Expand background rect range
|
||||||
{
|
{
|
||||||
if matches!(bg, Named(NamedColor::Background)) {
|
if matches!(bg, Named(NamedColor::Background)) {
|
||||||
//Continue to next cell, resetting variables if nescessary
|
//Continue to next cell, resetting variables if necessary
|
||||||
cur_alac_color = None;
|
cur_alac_color = None;
|
||||||
if let Some(rect) = cur_rect {
|
if let Some(rect) = cur_rect {
|
||||||
rects.push(rect);
|
rects.push(rect);
|
||||||
|
|
|
@ -804,7 +804,7 @@ mod tests {
|
||||||
let workspace = workspace.read(cx);
|
let workspace = workspace.read(cx);
|
||||||
let active_entry = project.read(cx).active_entry();
|
let active_entry = project.read(cx).active_entry();
|
||||||
|
|
||||||
//Make sure enviroment is as expeted
|
//Make sure environment is as expected
|
||||||
assert!(active_entry.is_none());
|
assert!(active_entry.is_none());
|
||||||
assert!(workspace.worktrees(cx).next().is_none());
|
assert!(workspace.worktrees(cx).next().is_none());
|
||||||
|
|
||||||
|
@ -825,7 +825,7 @@ mod tests {
|
||||||
let workspace = workspace.read(cx);
|
let workspace = workspace.read(cx);
|
||||||
let active_entry = project.read(cx).active_entry();
|
let active_entry = project.read(cx).active_entry();
|
||||||
|
|
||||||
//Make sure enviroment is as expeted
|
//Make sure environment is as expected
|
||||||
assert!(active_entry.is_none());
|
assert!(active_entry.is_none());
|
||||||
assert!(workspace.worktrees(cx).next().is_some());
|
assert!(workspace.worktrees(cx).next().is_some());
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ fn test_line_len() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_common_prefix_at_positionn() {
|
fn test_common_prefix_at_position() {
|
||||||
let text = "a = str; b = δα";
|
let text = "a = str; b = δα";
|
||||||
let buffer = Buffer::new(0, 0, text.into());
|
let buffer = Buffer::new(0, 0, text.into());
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ fn test_common_prefix_at_positionn() {
|
||||||
empty_range_after(text, "str"),
|
empty_range_after(text, "str"),
|
||||||
);
|
);
|
||||||
|
|
||||||
// prefix matching is case insenstive.
|
// prefix matching is case insensitive.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
buffer.common_prefix_at(offset1, "Strαngε"),
|
buffer.common_prefix_at(offset1, "Strαngε"),
|
||||||
range_of(text, "str"),
|
range_of(text, "str"),
|
||||||
|
|
|
@ -756,7 +756,7 @@ mod test {
|
||||||
ˇ
|
ˇ
|
||||||
The quick"})
|
The quick"})
|
||||||
.await;
|
.await;
|
||||||
// Indoc disallows trailing whitspace.
|
// Indoc disallows trailing whitespace.
|
||||||
cx.assert(" ˇ \nThe quick").await;
|
cx.assert(" ˇ \nThe quick").await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ use tokio::{
|
||||||
use crate::state::Mode;
|
use crate::state::Mode;
|
||||||
use collections::VecDeque;
|
use collections::VecDeque;
|
||||||
|
|
||||||
// Neovim doesn't like to be started simultaneously from multiple threads. We use thsi lock
|
// Neovim doesn't like to be started simultaneously from multiple threads. We use this lock
|
||||||
// to ensure we are only constructing one neovim connection at a time.
|
// to ensure we are only constructing one neovim connection at a time.
|
||||||
#[cfg(feature = "neovim")]
|
#[cfg(feature = "neovim")]
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
|
|
@ -1022,7 +1022,7 @@ impl Pane {
|
||||||
let is_active_item = target_item_id == active_item_id;
|
let is_active_item = target_item_id == active_item_id;
|
||||||
let target_pane = cx.weak_handle();
|
let target_pane = cx.weak_handle();
|
||||||
|
|
||||||
// The `CloseInactiveItems` action should really be called "CloseOthers" and the behaviour should be dynamically based on the tab the action is ran on. Currenlty, this is a weird action because you can run it on a non-active tab and it will close everything by the actual active tab
|
// The `CloseInactiveItems` action should really be called "CloseOthers" and the behaviour should be dynamically based on the tab the action is ran on. Currently, this is a weird action because you can run it on a non-active tab and it will close everything by the actual active tab
|
||||||
|
|
||||||
self.tab_context_menu.update(cx, |menu, cx| {
|
self.tab_context_menu.update(cx, |menu, cx| {
|
||||||
menu.show(
|
menu.show(
|
||||||
|
|
|
@ -4424,7 +4424,7 @@ mod tests {
|
||||||
assert!(!panel.has_focus(cx));
|
assert!(!panel.has_focus(cx));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Transfering focus back to the panel keeps it zoomed
|
// Transferring focus back to the panel keeps it zoomed
|
||||||
workspace.update(cx, |workspace, cx| {
|
workspace.update(cx, |workspace, cx| {
|
||||||
workspace.toggle_panel_focus::<TestPanel>(cx);
|
workspace.toggle_panel_focus::<TestPanel>(cx);
|
||||||
});
|
});
|
||||||
|
|
|
@ -207,7 +207,7 @@ impl LspAdapter for EsLintLspAdapter {
|
||||||
http: Arc<dyn HttpClient>,
|
http: Arc<dyn HttpClient>,
|
||||||
) -> Result<Box<dyn 'static + Send + Any>> {
|
) -> Result<Box<dyn 'static + Send + Any>> {
|
||||||
// At the time of writing the latest vscode-eslint release was released in 2020 and requires
|
// At the time of writing the latest vscode-eslint release was released in 2020 and requires
|
||||||
// special custom LSP protocol extensions be handled to fully initalize. Download the latest
|
// special custom LSP protocol extensions be handled to fully initialize. Download the latest
|
||||||
// prerelease instead to sidestep this issue
|
// prerelease instead to sidestep this issue
|
||||||
let release = latest_github_release("microsoft/vscode-eslint", true, http).await?;
|
let release = latest_github_release("microsoft/vscode-eslint", true, http).await?;
|
||||||
Ok(Box::new(GitHubLspBinaryVersion {
|
Ok(Box::new(GitHubLspBinaryVersion {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Allow binary to be called Zed for a nice application menu when running executable direcly
|
// Allow binary to be called Zed for a nice application menu when running executable directly
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
|
|
|
@ -23,7 +23,7 @@ function checkLicenses(
|
||||||
licenses: string[]
|
licenses: string[]
|
||||||
) {
|
) {
|
||||||
for (const { meta } of schemeMetaWithLicense) {
|
for (const { meta } of schemeMetaWithLicense) {
|
||||||
// FIXME: Add support for conjuctions and conditions
|
// FIXME: Add support for conjunctions and conditions
|
||||||
if (licenses.indexOf(meta.license.SPDX) < 0) {
|
if (licenses.indexOf(meta.license.SPDX) < 0) {
|
||||||
throw Error(
|
throw Error(
|
||||||
`License for theme ${meta.name} (${meta.license.SPDX}) is not supported`
|
`License for theme ${meta.name} (${meta.license.SPDX}) is not supported`
|
||||||
|
|
|
@ -112,7 +112,7 @@ export default function editor(colorScheme: ColorScheme) {
|
||||||
widthEm: 0.15,
|
widthEm: 0.15,
|
||||||
cornerRadius: 0.05,
|
cornerRadius: 0.05,
|
||||||
},
|
},
|
||||||
/** Highlights matching occurences of what is under the cursor
|
/** Highlights matching occurrences of what is under the cursor
|
||||||
* as well as matched brackets
|
* as well as matched brackets
|
||||||
*/
|
*/
|
||||||
documentHighlightReadBackground: withOpacity(
|
documentHighlightReadBackground: withOpacity(
|
||||||
|
|
|
@ -33,7 +33,7 @@ export default function search(colorScheme: ColorScheme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// TODO: Add an activeMatchBackground on the rust side to differenciate between active and inactive
|
// TODO: Add an activeMatchBackground on the rust side to differentiate between active and inactive
|
||||||
matchBackground: withOpacity(foreground(layer, "accent"), 0.4),
|
matchBackground: withOpacity(foreground(layer, "accent"), 0.4),
|
||||||
optionButton: {
|
optionButton: {
|
||||||
...text(layer, "mono", "on"),
|
...text(layer, "mono", "on"),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Curve } from "./ref/curves"
|
import { Curve } from "./ref/curves"
|
||||||
|
|
||||||
export interface ColorAccessiblityValue {
|
export interface ColorAccessibilityValue {
|
||||||
value: number
|
value: number
|
||||||
aaPass: boolean
|
aaPass: boolean
|
||||||
aaaPass: boolean
|
aaaPass: boolean
|
||||||
|
@ -12,14 +12,14 @@ export interface ColorAccessiblityValue {
|
||||||
* @note This implementation is currently basic – Currently we only calculate contrasts against black and white, in the future will allow for dynamic color contrast calculation based on the colors present in a given palette.
|
* @note This implementation is currently basic – Currently we only calculate contrasts against black and white, in the future will allow for dynamic color contrast calculation based on the colors present in a given palette.
|
||||||
* @note The goal is to align with WCAG3 accessibility standards as they become stabilized. See the [WCAG 3 Introduction](https://www.w3.org/WAI/standards-guidelines/wcag/wcag3-intro/) for more information.
|
* @note The goal is to align with WCAG3 accessibility standards as they become stabilized. See the [WCAG 3 Introduction](https://www.w3.org/WAI/standards-guidelines/wcag/wcag3-intro/) for more information.
|
||||||
*/
|
*/
|
||||||
export interface ColorAccessiblity {
|
export interface ColorAccessibility {
|
||||||
black: ColorAccessiblityValue
|
black: ColorAccessibilityValue
|
||||||
white: ColorAccessiblityValue
|
white: ColorAccessibilityValue
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Color = {
|
export type Color = {
|
||||||
step: number
|
step: number
|
||||||
contrast: ColorAccessiblity
|
contrast: ColorAccessibility
|
||||||
hex: string
|
hex: string
|
||||||
lch: number[]
|
lch: number[]
|
||||||
rgba: number[]
|
rgba: number[]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue