Auto focus should only trigger if the current tab is selected or else
closing an unfocused tab would move the focused tab.
See: pop-os/cosmic-files#1949
- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
Auto focus should only trigger if the current tab is selected or else
closing an unfocused tab would move the focused tab.
See: pop-os/cosmic-files#1949
- Add unicode-segmentation dependency for proper grapheme cluster support
- Replace chars() iteration with graphemes(true) for accurate character counting
- Fix counting of complex Unicode characters like emojis, combining characters, and multi-byte sequences
- Resolves TODO: 'do graphemes?' in document_statistics function
This change provides more accurate character counts for international text,
emojis with skin tones, combined characters, and other multi-codepoint graphemes.
Examples of improved accuracy:
- 👍🏾 now counts as 1 character instead of 2
- é (e + combining acute) counts as 1 character instead of 2
- 🧑💻 (person technologist) counts as 1 character instead of 4
- Add monospace_attrs() function in main.rs to centralize monospace font attributes creation
- Replace duplicated Attrs::new().family(Family::Monospace) calls in:
* line_number.rs: LineNumberCache::get() method
* main.rs: App::init() font enumeration
* tab.rs: EditorTab::new() constructor
- Remove unused imports (Attrs, Family) from line_number.rs
- Resolves TODO comments about code repetition across modules
This change improves maintainability by having a single source of truth
for monospace font configuration.
This fixes the issue where the nav bar would close when clicking a directory
in the nav bar when the window width was reduced to a size where only
the nav bar was visible.