Fix theme selector resetting the buffer size (#25425)

Closes https://github.com/zed-industries/zed/issues/25413

As the issue points out well, themes do not need to alter any in-memory
state on load: that is done via settings file load.
Originally, it was introduced in
https://github.com/zed-industries/zed/pull/4064 and
https://github.com/zed-industries/zed/pull/24857 had restored that
behavior, which seems wrong to do.

Apart from removing that part, removes unnecessary methods and
emphasizes that in-memory state is the Buffer/UI size — no need to add
`Adjusted` there as the settings file presence is already enough.

Release Notes:

- Fixed theme selector resetting the buffer size
This commit is contained in:
Kirill Bulatov 2025-02-23 17:24:43 +02:00 committed by GitHub
parent 822f42e8fe
commit 147f407b7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 39 additions and 74 deletions

View file

@ -59,6 +59,7 @@ const DEFAULT_NUM_COLUMNS: usize = 128;
pub fn text_style(window: &mut Window, cx: &mut App) -> TextStyle {
let settings = ThemeSettings::get_global(cx).clone();
let font_size = settings.buffer_font_size(cx).into();
let font_family = settings.buffer_font.family;
let font_features = settings.buffer_font.features;
let font_weight = settings.buffer_font.weight;
@ -71,7 +72,7 @@ pub fn text_style(window: &mut Window, cx: &mut App) -> TextStyle {
font_features,
font_weight,
font_fallbacks,
font_size: theme::get_buffer_font_size(cx).into(),
font_size,
font_style: FontStyle::Normal,
line_height: window.line_height().into(),
background_color: Some(theme.colors().terminal_ansi_background),