Current implementation fails on partial stage/unstage/discard operations for
non-UTF8 text because of applying a patch made with broken (replaced) text.
This modification allows these operation by preserving the original raw bytes
from the output of `git diff`, and use it to create patch file.
This issue is introduced by commit 26fc29bce6. And the right way to fix this issue is to force `Command.Commit` finish in UI thread.
Signed-off-by: leo <longshuang@msn.cn>
Each line is divided into several chunks to highlight the changes.
The previous implementation splits text at a fixed set of delimiter
characters (spaces, tabs, and common ASCII symbols such as `+-*/=!,;`).
Non-delimiter characters — including CJK ideographs, Hiragana, and
Katakana — are never treated as boundaries, so they tend to form large,
coarse chunks in languages like Japanese or Chinese that do not use
spaces to separate words. A small change within such text causes the
entire surrounding phrase to be highlighted.
This new implementation classifies each character into one of three
categories and groups consecutive characters of the same category into
one chunk, except for the Other category which is always split
character by character:
- Letter (Unicode Ll/Lu/Lt/Lm + digits): ASCII letters, digits, and
letters with diacritics such as é, ü, ß, ñ, ё. Consecutive Letter
characters form one chunk, keeping European words intact.
- OtherLetter (Unicode Lo): CJK, Hiragana, Katakana, Hangul, Thai,
Arabic, Hebrew, etc. Consecutive OtherLetter characters form one
chunk. CJK punctuation (。、「」…) falls into the Other category
and therefore acts as a natural boundary between chunks.
- Other (default): whitespace, control characters, punctuation, and
symbols. This category corresponds to the delimiter characters of
the previous implementation. Each character is always its own chunk,
preserving the same per-character precision as before for operators,
spaces, and punctuation.
Category values for all 65,536 char values are pre-computed into a
static read-only array at startup for lock-free O(1) lookup.
* feature: allow editing of repository name via context menu of repository tab
Now we can edit tab name while seeing repository view.
This is a same feature of 'Edit' action for repository path in welcome view.
Add text resource "Text.PageTabBar.Tab.Edit" and its translations are copied
from "Text.Welcome.Edit".
Note: The feature of changing bookmark is duplicated in a sub menu and
the edit dialog.
* refactor: remove duplicated menu action 'Bookmark'
Remove the 'Bookmark' sub-menu action because 'Edit' action contains it.
The text resource "PageTabBar.Tab.Bookmark" and its translations are also removed.
- Modal dialog must display error message on top of its self
- Commands should only depends on Models and Native
Signed-off-by: leo <longshuang@msn.cn>