Skip to content

TeXstudio double counts Unicode characters leading to wrong alignment #2427

Open
@randolf-scholz

Description

@randolf-scholz

Consider the following code

\newunicodechar{𝔸}{\mathds{a}}
\newunicodechar{𝔹}{\mathds{B}}
\newunicodechar{ℂ}{\mathds{C}}
\newunicodechar{𝔻}{\mathds{D}}
\newunicodechar{𝔼}{\mathds{E}}

When trying to block select the second curly brackets, TeXstudio selects the wrong characters in the 3rd line

image

The same issue is not present in other editors such as VS Code

image

I suspect the issue originals from coming from a different block in Unicode than the other double stroke characters and taking less bytes, so somehow TeXstudio counts only as 1 character, but it counts 𝔹 as 2 characters. This can be verified by the column number: right after TexStudio says we are at column 17, right after 𝔹 TeXstudio thinks we are at column 18.

I originally posted this issue here: https://tex.stackexchange.com/questions/644310/using-texstudio-with-unicode-incorrect-cursor-position

Environment

  • TeXstudio: 4.2.3
  • Qt: Using Qt Version 5.15.3, compiled with Qt 5.15.3 R
  • OS: Ubuntu 22.04 LTS
  • TeX distribution: texlive-2021

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions