[PR #3727] [MERGED] Make CodepointWidthDetector::GetWidth faster #25488

Open
opened 2026-01-31 09:09:49 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/3727
Author: @skyline75489
Created: 11/27/2019
Status: Merged
Merged: 4/4/2020
Merged by: @undefined

Base: masterHead: fix/codepointWidthDetectorPart1


📝 Commits (3)

  • ef5bf91 Make CodepointWidthDetector::GetWidth faster
  • ed79d7f Fix ambiguous detection
  • 877cc21 Merge remote-tracking branch 'origin/master' into skyline

📊 Changes

2 files changed (+68 additions, -52 deletions)

View changed files

📝 src/types/CodepointWidthDetector.cpp (+66 -51)
📝 src/types/inc/CodepointWidthDetector.hpp (+2 -1)

📄 Description

This is a subset of #3578 which I think is harmless and the first step towards making things right.
References #3546 #3578

Detailed Description of the Pull Request / Additional comments

For more robust Unicode support, CodepointWidthDetector should provide concrete width information rather than a simple boolean of IsWide. Currently only IsWide is widely used and optimized using quick lookup table and fallback cache. This PR moves those optimization into GetWidth.

Validation Steps Performed

API remains unchanged. Things are not broken.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/3727 **Author:** [@skyline75489](https://github.com/skyline75489) **Created:** 11/27/2019 **Status:** ✅ Merged **Merged:** 4/4/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `fix/codepointWidthDetectorPart1` --- ### 📝 Commits (3) - [`ef5bf91`](https://github.com/microsoft/terminal/commit/ef5bf9147654416d66035f83f8beb97531fd3610) Make CodepointWidthDetector::GetWidth faster - [`ed79d7f`](https://github.com/microsoft/terminal/commit/ed79d7f735238c2af0c63c63c37fb7ed50af6734) Fix ambiguous detection - [`877cc21`](https://github.com/microsoft/terminal/commit/877cc21b77c20c1286f9ec41f3c4a86026060f12) Merge remote-tracking branch 'origin/master' into skyline ### 📊 Changes **2 files changed** (+68 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `src/types/CodepointWidthDetector.cpp` (+66 -51) 📝 `src/types/inc/CodepointWidthDetector.hpp` (+2 -1) </details> ### 📄 Description This is a subset of #3578 which I think is harmless and the first step towards making things right. References #3546 #3578 ## Detailed Description of the Pull Request / Additional comments For more robust Unicode support, `CodepointWidthDetector` should provide concrete width information rather than a simple boolean of `IsWide`. Currently only `IsWide` is widely used and optimized using quick lookup table and fallback cache. This PR moves those optimization into `GetWidth`. ## Validation Steps Performed API remains unchanged. Things are not broken. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:09:49 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25488