Preserve indentation state across focus changes and restarts
System information
- OS: Arch Linux + GNOME 42.3 on Wayland
- Text Editor version: 43.alpha1-3-geef3a136 from Gnome Nightly.
Bug information
Current behavior
When the user has enabled 'Discover Document Settings' and has a known file type (like a .c
file) open in a tab, they can runtime override the indentation settings for that tab through context menu > Indentation menu. But Text Editor immediately undoes the indentation settings the user set when the tab loses keyboard focus in any way (open activities overview, switch to another window or tab).
Expected behavior
My understanding from #448 (comment 1526394) is that users should not be able to override indentation settings at runtime when 'Discover Document Settings' is enabled and a known file type (like a .c
file) is open in the tab. The context menu > Indentation menu should in these cases make the indentation settings read-only.
Edit: as per below I misunderstood the linked comment. When the user overrides indentation settings at runtime—when 'Discover Document Settings' is enabled and a known file type (like a .c
file) is open in the tab—those settings should not be reset when the tab loses keyboard focus.
Steps to reproduce
I do not have any modelines or editorconfig files and I reset the app configuration with rm -rf ~/.var/app/org.gnome.TextEditor.Devel
before doing the below. It only happens when 'Discover Document Settings' is enabled in Preferences.
- In a blank document type something and save it as
test.c
. - Press the Tab key, it inserts 2 spaces
- Open context menu > Indentation > Spaces per Indent and set it to 8
- Press the Tab key again, now it inserts 8 spaces
- Do something to lose keyboard focus from Text Editor -- go to activities overview, switch to another window or tab
- Go back to
test.c
in Text Editor - Press the Tab key again, now it inserts 2 spaces -- context menu > Indentation > Spaces per Indent is also reset to 2