Allow ignoring soft wraps when moving to line ends (#11153)

Release Notes:

- Fixed #10888

This patch addresses behavior of
`Editor::move_to_{beginning|end}_of_line`. It adds a setting,
`stop_at_soft_wraps` when defining a keymap for the
`editor::MoveToBeginningOfLine` and `editor::MoveToEndOfLine` actions.
When `true`, it causes movement to the either end of the line (via, for
example Home or End), to go to the logical end, as opposed to the
nearest soft wrap point in the respective direction.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
Tarun Verghis 2024-05-02 02:30:45 -07:00 committed by GitHub
parent c81230405f
commit edff78e722
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 140 additions and 27 deletions

View file

@ -13,6 +13,7 @@ use schemars::{
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsLocation, SettingsSources};
use std::{num::NonZeroU32, path::Path, sync::Arc};
use util::serde::default_true;
impl<'a> Into<SettingsLocation<'a>> for &'a dyn File {
fn into(self) -> SettingsLocation<'a> {
@ -438,10 +439,6 @@ pub struct InlayHintSettings {
pub scroll_debounce_ms: u64,
}
fn default_true() -> bool {
true
}
fn edit_debounce_ms() -> u64 {
700
}