NStack icon indicating copy to clipboard operation
NStack copied to clipboard

Support unicode chars

Open awaescher opened this issue 6 years ago • 0 comments

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 avatar Feb 07 '19 12:02 awaescher