mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Use US English spelling of "behavior" and "customize" (#15117)
This PR fixes some instances that weren't using US English spellings of "behavior" and "customize". Release Notes: - N/A
This commit is contained in:
parent
9c9a0bd24f
commit
0297a42735
@ -561,7 +561,7 @@ impl DisplaySnapshot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// used by line_mode selections and tries to match vim behaviour
|
// used by line_mode selections and tries to match vim behavior
|
||||||
pub fn expand_to_line(&self, range: Range<Point>) -> Range<Point> {
|
pub fn expand_to_line(&self, range: Range<Point>) -> Range<Point> {
|
||||||
let new_start = if range.start.row == 0 {
|
let new_start = if range.start.row == 0 {
|
||||||
MultiBufferPoint::new(0, 0)
|
MultiBufferPoint::new(0, 0)
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
//!
|
//!
|
||||||
//! All other submodules and structs are mostly concerned with holding editor data about the way it displays current buffer region(s).
|
//! All other submodules and structs are mostly concerned with holding editor data about the way it displays current buffer region(s).
|
||||||
//!
|
//!
|
||||||
//! If you're looking to improve Vim mode, you should check out Vim crate that wraps Editor and overrides its behaviour.
|
//! If you're looking to improve Vim mode, you should check out Vim crate that wraps Editor and overrides its behavior.
|
||||||
pub mod actions;
|
pub mod actions;
|
||||||
mod blame_entry_tooltip;
|
mod blame_entry_tooltip;
|
||||||
mod blink_manager;
|
mod blink_manager;
|
||||||
|
@ -96,7 +96,7 @@ pub fn box_shadow_style_methods(input: TokenStream) -> TokenStream {
|
|||||||
/// In addition to passing a TestAppContext, you can also ask for a `StdRnd` instance.
|
/// In addition to passing a TestAppContext, you can also ask for a `StdRnd` instance.
|
||||||
/// this will be seeded with the `SEED` environment variable and is used internally by
|
/// this will be seeded with the `SEED` environment variable and is used internally by
|
||||||
/// the ForegroundExecutor and BackgroundExecutor to run tasks deterministically in tests.
|
/// the ForegroundExecutor and BackgroundExecutor to run tasks deterministically in tests.
|
||||||
/// Using the same `StdRng` for behaviour in your test will allow you to exercise a wide
|
/// Using the same `StdRng` for behavior in your test will allow you to exercise a wide
|
||||||
/// variety of scenarios and interleavings just by changing the seed.
|
/// variety of scenarios and interleavings just by changing the seed.
|
||||||
///
|
///
|
||||||
/// #[gpui::test] also takes three different arguments:
|
/// #[gpui::test] also takes three different arguments:
|
||||||
|
@ -30,7 +30,7 @@ pub struct OutlinePanelSettingsContent {
|
|||||||
///
|
///
|
||||||
/// Default: true
|
/// Default: true
|
||||||
pub button: Option<bool>,
|
pub button: Option<bool>,
|
||||||
/// Customise default width (in pixels) taken by outline panel
|
/// Customize default width (in pixels) taken by outline panel
|
||||||
///
|
///
|
||||||
/// Default: 240
|
/// Default: 240
|
||||||
pub default_width: Option<f32>,
|
pub default_width: Option<f32>,
|
||||||
|
@ -38,7 +38,7 @@ pub enum DirenvSettings {
|
|||||||
ShellHook,
|
ShellHook,
|
||||||
/// Load direnv configuration directly using `direnv export json`
|
/// Load direnv configuration directly using `direnv export json`
|
||||||
///
|
///
|
||||||
/// Warning: This option is experimental and might cause some inconsistent behaviour compared to using the shell hook.
|
/// Warning: This option is experimental and might cause some inconsistent behavior compared to using the shell hook.
|
||||||
/// If it does, please report it to GitHub
|
/// If it does, please report it to GitHub
|
||||||
Direct,
|
Direct,
|
||||||
}
|
}
|
||||||
|
@ -654,7 +654,7 @@ impl ProjectPanel {
|
|||||||
|
|
||||||
pub fn collapse_all_entries(&mut self, _: &CollapseAllEntries, cx: &mut ViewContext<Self>) {
|
pub fn collapse_all_entries(&mut self, _: &CollapseAllEntries, cx: &mut ViewContext<Self>) {
|
||||||
// By keeping entries for fully collapsed worktrees, we avoid expanding them within update_visible_entries
|
// By keeping entries for fully collapsed worktrees, we avoid expanding them within update_visible_entries
|
||||||
// (which is it's default behaviour when there's no entry for a worktree in expanded_dir_ids).
|
// (which is it's default behavior when there's no entry for a worktree in expanded_dir_ids).
|
||||||
self.expanded_dir_ids
|
self.expanded_dir_ids
|
||||||
.retain(|_, expanded_entries| expanded_entries.is_empty());
|
.retain(|_, expanded_entries| expanded_entries.is_empty());
|
||||||
self.update_visible_entries(None, cx);
|
self.update_visible_entries(None, cx);
|
||||||
|
@ -60,7 +60,7 @@ pub struct ProjectPanelSettingsContent {
|
|||||||
///
|
///
|
||||||
/// Default: true
|
/// Default: true
|
||||||
pub button: Option<bool>,
|
pub button: Option<bool>,
|
||||||
/// Customise default width (in pixels) taken by project panel
|
/// Customize default width (in pixels) taken by project panel
|
||||||
///
|
///
|
||||||
/// Default: 240
|
/// Default: 240
|
||||||
pub default_width: Option<f32>,
|
pub default_width: Option<f32>,
|
||||||
|
@ -6,9 +6,9 @@ The backlog is maintained in the `#vim` channel notes.
|
|||||||
|
|
||||||
## Testing against Neovim
|
## Testing against Neovim
|
||||||
|
|
||||||
If you are making a change to make Zed's behaviour more closely match vim/nvim, you can create a test using the `NeovimBackedTestContext`.
|
If you are making a change to make Zed's behavior more closely match vim/nvim, you can create a test using the `NeovimBackedTestContext`.
|
||||||
|
|
||||||
For example, the following test checks that Zed and Neovim have the same behaviour when running `*` in visual mode:
|
For example, the following test checks that Zed and Neovim have the same behavior when running `*` in visual mode:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
@ -31,6 +31,6 @@ cargo test -p vim --features neovim test_visual_star_hash
|
|||||||
This will run your keystrokes against a headless neovim and cache the results in the test_data directory.
|
This will run your keystrokes against a headless neovim and cache the results in the test_data directory.
|
||||||
|
|
||||||
|
|
||||||
## Testing zed-only behaviour
|
## Testing zed-only behavior
|
||||||
|
|
||||||
Zed does more than vim/neovim in their default modes. The `VimTestContext` can be used instead. This lets you test integration with the language server and other parts of zed's UI that don't have a NeoVim equivalent.
|
Zed does more than vim/neovim in their default modes. The `VimTestContext` can be used instead. This lets you test integration with the language server and other parts of zed's UI that don't have a NeoVim equivalent.
|
||||||
|
@ -35,7 +35,7 @@ impl SharedState {
|
|||||||
pub fn assert_matches(&self) {
|
pub fn assert_matches(&self) {
|
||||||
if self.neovim != self.editor || self.neovim_mode != self.editor_mode {
|
if self.neovim != self.editor || self.neovim_mode != self.editor_mode {
|
||||||
panic!(
|
panic!(
|
||||||
indoc! {"Test failed (zed does not match nvim behaviour)
|
indoc! {"Test failed (zed does not match nvim behavior)
|
||||||
# initial state:
|
# initial state:
|
||||||
{}
|
{}
|
||||||
# keystrokes:
|
# keystrokes:
|
||||||
@ -67,7 +67,7 @@ impl SharedState {
|
|||||||
let message = if self.neovim != marked_text {
|
let message = if self.neovim != marked_text {
|
||||||
"Test is incorrect (currently expected != neovim_state)"
|
"Test is incorrect (currently expected != neovim_state)"
|
||||||
} else {
|
} else {
|
||||||
"Editor does not match nvim behaviour"
|
"Editor does not match nvim behavior"
|
||||||
};
|
};
|
||||||
panic!(
|
panic!(
|
||||||
indoc! {"{}
|
indoc! {"{}
|
||||||
@ -110,7 +110,7 @@ impl SharedClipboard {
|
|||||||
let message = if expected == self.neovim {
|
let message = if expected == self.neovim {
|
||||||
"Test is incorrect (currently expected != neovim_state)"
|
"Test is incorrect (currently expected != neovim_state)"
|
||||||
} else {
|
} else {
|
||||||
"Editor does not match nvim behaviour"
|
"Editor does not match nvim behavior"
|
||||||
};
|
};
|
||||||
|
|
||||||
panic!(
|
panic!(
|
||||||
|
@ -392,7 +392,7 @@ impl Vim {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// When handling an action, you must create visual marks if you will switch to normal
|
// When handling an action, you must create visual marks if you will switch to normal
|
||||||
// mode without the default selection behaviour.
|
// mode without the default selection behavior.
|
||||||
fn store_visual_marks(&mut self, cx: &mut WindowContext) {
|
fn store_visual_marks(&mut self, cx: &mut WindowContext) {
|
||||||
let mode = self.state().mode;
|
let mode = self.state().mode;
|
||||||
if mode.is_visual() {
|
if mode.is_visual() {
|
||||||
|
@ -92,7 +92,7 @@ use ui::{
|
|||||||
use util::{maybe, ResultExt, TryFutureExt};
|
use util::{maybe, ResultExt, TryFutureExt};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
pub use workspace_settings::{
|
pub use workspace_settings::{
|
||||||
AutosaveSetting, RestoreOnStartupBehaviour, TabBarSettings, WorkspaceSettings,
|
AutosaveSetting, RestoreOnStartupBehavior, TabBarSettings, WorkspaceSettings,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::notifications::NotificationId;
|
use crate::notifications::NotificationId;
|
||||||
|
@ -12,7 +12,7 @@ pub struct WorkspaceSettings {
|
|||||||
pub confirm_quit: bool,
|
pub confirm_quit: bool,
|
||||||
pub show_call_status_icon: bool,
|
pub show_call_status_icon: bool,
|
||||||
pub autosave: AutosaveSetting,
|
pub autosave: AutosaveSetting,
|
||||||
pub restore_on_startup: RestoreOnStartupBehaviour,
|
pub restore_on_startup: RestoreOnStartupBehavior,
|
||||||
pub drop_target_size: f32,
|
pub drop_target_size: f32,
|
||||||
pub when_closing_with_no_tabs: CloseWindowWhenNoItems,
|
pub when_closing_with_no_tabs: CloseWindowWhenNoItems,
|
||||||
pub use_system_path_prompts: bool,
|
pub use_system_path_prompts: bool,
|
||||||
@ -43,7 +43,7 @@ impl CloseWindowWhenNoItems {
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Default, Serialize, Deserialize, JsonSchema)]
|
#[derive(Copy, Clone, Default, Serialize, Deserialize, JsonSchema)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
pub enum RestoreOnStartupBehaviour {
|
pub enum RestoreOnStartupBehavior {
|
||||||
/// Always start with an empty editor
|
/// Always start with an empty editor
|
||||||
None,
|
None,
|
||||||
/// Restore the workspace that was closed last.
|
/// Restore the workspace that was closed last.
|
||||||
@ -78,7 +78,7 @@ pub struct WorkspaceSettingsContent {
|
|||||||
/// Controls previous session restoration in freshly launched Zed instance.
|
/// Controls previous session restoration in freshly launched Zed instance.
|
||||||
/// Values: none, last_workspace, last_session
|
/// Values: none, last_workspace, last_session
|
||||||
/// Default: last_session
|
/// Default: last_session
|
||||||
pub restore_on_startup: Option<RestoreOnStartupBehaviour>,
|
pub restore_on_startup: Option<RestoreOnStartupBehavior>,
|
||||||
/// The size of the workspace split drop targets on the outer edges.
|
/// The size of the workspace split drop targets on the outer edges.
|
||||||
/// Given as a fraction that will be multiplied by the smaller dimension of the workspace.
|
/// Given as a fraction that will be multiplied by the smaller dimension of the workspace.
|
||||||
///
|
///
|
||||||
|
@ -697,27 +697,27 @@ pub(crate) async fn restorable_workspace_locations(
|
|||||||
cx: &mut AsyncAppContext,
|
cx: &mut AsyncAppContext,
|
||||||
app_state: &Arc<AppState>,
|
app_state: &Arc<AppState>,
|
||||||
) -> Option<Vec<workspace::LocalPaths>> {
|
) -> Option<Vec<workspace::LocalPaths>> {
|
||||||
let mut restore_behaviour = cx
|
let mut restore_behavior = cx
|
||||||
.update(|cx| WorkspaceSettings::get(None, cx).restore_on_startup)
|
.update(|cx| WorkspaceSettings::get(None, cx).restore_on_startup)
|
||||||
.ok()?;
|
.ok()?;
|
||||||
|
|
||||||
let last_session_id = app_state.session.last_session_id();
|
let last_session_id = app_state.session.last_session_id();
|
||||||
if last_session_id.is_none()
|
if last_session_id.is_none()
|
||||||
&& matches!(
|
&& matches!(
|
||||||
restore_behaviour,
|
restore_behavior,
|
||||||
workspace::RestoreOnStartupBehaviour::LastSession
|
workspace::RestoreOnStartupBehavior::LastSession
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
restore_behaviour = workspace::RestoreOnStartupBehaviour::LastWorkspace;
|
restore_behavior = workspace::RestoreOnStartupBehavior::LastWorkspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
match restore_behaviour {
|
match restore_behavior {
|
||||||
workspace::RestoreOnStartupBehaviour::LastWorkspace => {
|
workspace::RestoreOnStartupBehavior::LastWorkspace => {
|
||||||
workspace::last_opened_workspace_paths()
|
workspace::last_opened_workspace_paths()
|
||||||
.await
|
.await
|
||||||
.map(|location| vec![location])
|
.map(|location| vec![location])
|
||||||
}
|
}
|
||||||
workspace::RestoreOnStartupBehaviour::LastSession => {
|
workspace::RestoreOnStartupBehavior::LastSession => {
|
||||||
if let Some(last_session_id) = last_session_id {
|
if let Some(last_session_id) = last_session_id {
|
||||||
workspace::last_session_workspace_locations(last_session_id)
|
workspace::last_session_workspace_locations(last_session_id)
|
||||||
.filter(|locations| !locations.is_empty())
|
.filter(|locations| !locations.is_empty())
|
||||||
|
@ -10,7 +10,7 @@ Your settings file can be opened with `cmd-,` (on macOS) or `ctrl-,` (on Linux).
|
|||||||
|
|
||||||
This configuration is merged with any local configuration inside your projects. You can open the project settings by running `zed: Open Local Settings` from the command palette. This will create a `.zed` directory containing`.zed/settings.json`.
|
This configuration is merged with any local configuration inside your projects. You can open the project settings by running `zed: Open Local Settings` from the command palette. This will create a `.zed` directory containing`.zed/settings.json`.
|
||||||
|
|
||||||
Although most projects will only need one settings file at the root, you can add more local settings files for subdirectories as needed. Not all settings can be set in local files, just those that impact the behaviour of the editor and language tooling. For example you can set `tab_size`, `formatter` etc. but not `theme`, `vim_mode` and similar.
|
Although most projects will only need one settings file at the root, you can add more local settings files for subdirectories as needed. Not all settings can be set in local files, just those that impact the behavior of the editor and language tooling. For example you can set `tab_size`, `formatter` etc. but not `theme`, `vim_mode` and similar.
|
||||||
|
|
||||||
The syntax for configuration files is a super-set of JSON that allows `//` comments.
|
The syntax for configuration files is a super-set of JSON that allows `//` comments.
|
||||||
|
|
||||||
@ -1562,7 +1562,7 @@ Run the `theme selector: toggle` action in the command palette to see a current
|
|||||||
|
|
||||||
## Project Panel
|
## Project Panel
|
||||||
|
|
||||||
- Description: Customise project panel
|
- Description: Customize project panel
|
||||||
- Setting: `project_panel`
|
- Setting: `project_panel`
|
||||||
- Default:
|
- Default:
|
||||||
|
|
||||||
@ -1633,7 +1633,7 @@ Run the `theme selector: toggle` action in the command palette to see a current
|
|||||||
|
|
||||||
### Default Width
|
### Default Width
|
||||||
|
|
||||||
- Description: Customise default width taken by project panel
|
- Description: Customize default width taken by project panel
|
||||||
- Setting: `default_width`
|
- Setting: `default_width`
|
||||||
- Default: N/A width in pixels (eg: 420)
|
- Default: N/A width in pixels (eg: 420)
|
||||||
|
|
||||||
@ -1728,7 +1728,7 @@ Run the `theme selector: toggle` action in the command palette to see a current
|
|||||||
|
|
||||||
## Calls
|
## Calls
|
||||||
|
|
||||||
- Description: Customise behaviour when participating in a call
|
- Description: Customize behavior when participating in a call
|
||||||
- Setting: `calls`
|
- Setting: `calls`
|
||||||
- Default:
|
- Default:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user