From d297aa69a94d944d32d9c4e63a364b7f8e3c39a1 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Thu, 11 Sep 2025 07:15:05 +0530 Subject: [PATCH] take 2 on scroll perf for macos 26 --- crates/gpui/src/platform.rs | 3 +++ crates/gpui/src/platform/mac/platform.rs | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs index 444b60ac154424c423c3cd6a827b22cd7024694f..a7e5bc2424c04ad91530d728a8668d22c12552b2 100644 --- a/crates/gpui/src/platform.rs +++ b/crates/gpui/src/platform.rs @@ -957,6 +957,9 @@ impl PlatformInputHandler { } pub fn selected_bounds(&mut self, window: &mut Window, cx: &mut App) -> Option> { + if self.handler.marked_text_range(window, cx).is_none() { + return None; + } let selection = self.handler.selected_text_range(true, window, cx)?; self.handler.bounds_for_range( if selection.reversed { diff --git a/crates/gpui/src/platform/mac/platform.rs b/crates/gpui/src/platform/mac/platform.rs index dea04d89a06acac526a8b033681829fdc1e148fd..317b64ed6f00ac53a4ca6cc3509e5128b0ddf2bd 100644 --- a/crates/gpui/src/platform/mac/platform.rs +++ b/crates/gpui/src/platform/mac/platform.rs @@ -1370,6 +1370,19 @@ extern "C" fn did_finish_launching(this: &mut Object, _: Sel, _: id) { object: nil ]; + let defaults: id = msg_send![class!(NSUserDefaults), standardUserDefaults]; + let keys: [id; 6] = [ + ns_string("NSAutomaticTextCompletionEnabled"), + ns_string("NSAutomaticSpellingCorrectionEnabled"), + ns_string("NSAutomaticQuoteSubstitutionEnabled"), + ns_string("NSAutomaticDashSubstitutionEnabled"), + ns_string("NSAutomaticPeriodSubstitutionEnabled"), + ns_string("NSAutomaticCapitalizationEnabled"), + ]; + for key in keys { + let _: () = msg_send![defaults, setBool: NO forKey: key]; + } + let platform = get_mac_platform(this); let callback = platform.0.lock().finish_launching.take(); if let Some(callback) = callback {