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

Support unicode chars #43

Open
awaescher opened this issue Feb 7, 2019 · 0 comments
Open

Support unicode chars #43

awaescher opened this issue Feb 7, 2019 · 0 comments

Comments

@awaescher
Copy link

awaescher commented Feb 7, 2019

This is an issue I filed in gui.cs a while ago.
I took a look in NStack and I think I found the reason, so I'll open this issue to be able to fix it with a PR.

Issue

I am currently using some unicode signs like in gui.cs: ≡ ⌂ ↑ ↓ …

unicodesguics

While rendering them in a ListView or TextField, I got a IndexOutOfRangeException. In Labels, everything is okay.

   at System.Rune.bisearch(UInt32 rune, UInt32[,] table, Int32 max)
   at System.Rune.ColumnWidth(Rune rune)
   at Terminal.Gui.ListView.ListWrapper.RenderUstr(ustring ustr, Int32 col, Int32 line, Int32 width)
   at Terminal.Gui.ListView.ListWrapper.Render(Boolean marked, Int32 item, Int32 col, Int32 line, Int32 width)
   at Terminal.Gui.ListView.Redraw(Rect region)
   at Terminal.Gui.View.Redraw(Rect region)
   at Terminal.Gui.Window.Redraw(Rect bounds)
   at Terminal.Gui.View.Redraw(Rect region)
   at Terminal.Gui.Application.Redraw(View view)
   at Terminal.Gui.Application.Begin(Toplevel toplevel)
   at Terminal.Gui.Application.Run(Toplevel view)
   at grrui.Program.Main(String[] args) in D:\Develop\GitHub\RepoZ\grrui\Program.cs:line 43

It turns out that "\u2261" for example, returns Rune 8801. Rune.ColumnWidth(8801) throws.

indexoutofrangeexception

@awaescher awaescher changed the title Support unicode chars in ListViews and TextFields Support unicode chars Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant