Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zero-width characters and control characters attribute issue. #1741

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/character/string-width-utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
table))

(defun control-char (char)
(values (gethash char *char-replacement*)))
(gethash char *char-replacement*))

(defun wide-char-p (char)
(declare (character char))
Expand Down
4 changes: 3 additions & 1 deletion src/display/char-type.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
(icon-value code :font))

(defun zero-width-char-code-p (code)
(or (<= #x200B code #x200D) (= code #xFEFF)))
(or (<= #x200B code #x200D)
(<= #xFE00 code #xFE0F)
(= code #xFEFF)))

(defun char-type (char)
(let ((code (char-code char)))
Expand Down
9 changes: 5 additions & 4 deletions src/display/physical-line.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@
string))
:attribute (case type
((:control :zero-width)
(merge-attribute attribute
(ensure-attribute 'special-char-attribute nil)))
(otherwise
attribute))
(let ((attr (ensure-attribute 'special-char-attribute nil)))
(if attribute
(merge-attribute attribute attr)
attr)))
(otherwise attribute))
:type type
:within-cursor (and attribute
(cursor-attribute-p attribute)))))
Expand Down
Loading