Skip to content

Commit

Permalink
highlight_on_copy -> highlight_on_yank
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Dec 3, 2024
1 parent 544f947 commit 455cfd9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@
"use_system_clipboard": "always",
"use_multiline_find": false,
"use_smartcase_find": false,
"highlight_on_copy_duration": 200,
"highlight_on_yank_duration": 200,
"custom_digraphs": {}
},
// The server to connect to. If the environment variable
Expand Down
2 changes: 1 addition & 1 deletion crates/vim/src/normal/yank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl Vim {
)
});

let highlight_duration = VimSettings::get_global(cx).highlight_on_copy_duration;
let highlight_duration = VimSettings::get_global(cx).highlight_on_yank_duration;
if !is_yank || self.mode == Mode::Visual || highlight_duration == 0 {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions crates/vim/src/vim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ struct VimSettings {
pub use_multiline_find: bool,
pub use_smartcase_find: bool,
pub custom_digraphs: HashMap<String, Arc<str>>,
pub highlight_on_copy_duration: u64,
pub highlight_on_yank_duration: u64,
}

#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
Expand All @@ -1198,7 +1198,7 @@ struct VimSettingsContent {
pub use_multiline_find: Option<bool>,
pub use_smartcase_find: Option<bool>,
pub custom_digraphs: Option<HashMap<String, Arc<str>>>,
pub highlight_on_copy_duration: Option<u64>,
pub highlight_on_yank_duration: Option<u64>,
}

impl Settings for VimSettings {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/vim.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ You can change the following settings to modify vim mode's behavior:
| use_smartcase_find | If `true`, `f` and `t` motions are case-insensitive when the target letter is lowercase. | false |
| toggle_relative_line_numbers | If `true`, line numbers are relative in normal mode and absolute in insert mode, giving you the best of both options. | false |
| custom_digraphs | An object that allows you to add custom digraphs. Read below for an example. | {} |
| highlight_on_copy_duration | The duration of the higlight animation(in ms). Set to `0` to disable | 200 |
| highlight_on_yank_duration | The duration of the higlight animation(in ms). Set to `0` to disable | 200 |

Here's an example of adding a digraph for the zombie emoji. This allows you to type `ctrl-k f z` to insert a zombie emoji. You can add as many digraphs as you like.

Expand All @@ -432,7 +432,7 @@ Here's an example of these settings changed:
"use_multiline_find": true,
"use_smartcase_find": true,
"toggle_relative_line_numbers": true,
"highlight_on_copy_duration": 50,
"highlight_on_yank_duration": 50,
"custom_digraphs": {
"fz": "🧟‍♀️"
}
Expand Down

0 comments on commit 455cfd9

Please sign in to comment.