nsf / godit

A very religious text editor
MIT License
578 stars 76 forks source link

Use dash. #12

Closed mattn closed 9 years ago

mattn commented 10 years ago

is single cells in english locales, but in asia locales, it is two cells.

nsf commented 10 years ago

Yeah, it's kind of sad. Especially because the issue is windows-only.

I won't accept this patch as is, because it makes godit really ugly when using multiple views. See these lines: https://github.com/nsf/godit/blob/master/godit.go#L337-L412

Perhaps it's worth adjusting all of them. But since there are no like symbols in basic ASCII, we will have to replace them with +, therefore no need for fix_edges method. The only purpose of which is to make things nice and smooth.

mattn commented 10 years ago

ok, btw, it's not issue just for windows. it's depend on locale. the some characters are two cells on japanese/chinese/korean locale.

nsf commented 10 years ago

Well, as far as I know on linux this character takes one cell, but I checked of course on ru_RU locale, maybe on CJK locales it's different, but it would be really weird. I mean locale contains an encoding, in most cases on linux it's UTF-8, and some info regarding numbers and such. I doubt it contains requirements regarding sizes of the box drawing characters.

mattn commented 10 years ago

In UTF-8, there are ambiguous spec. See here: http://www.unicode.org/reports/tr11/

mattn commented 10 years ago

And https://github.com/mattn/go-runewidth this can get asian width.

nsf commented 10 years ago

I see, well, as usual things are a mess. Patches are welcome, both to godit and termbox. Regarding this pull request as I said, make it complete and I'll merge it.

Frankly, I don't use godit and termbox much anymore.

I'm working on a C++ project using Qt Creator as a main editor right now, even wrote a plugin for it: https://github.com/nsf/emacskeys (it's not the most recent version though, I'm working on merging it to their git repo, or will be doing binary releases after 3.1 release). And other than that I just use emacs. :) Godit is still nice when you quickly need to get a fully functional text editor without installing emacs.

mattn commented 10 years ago

Frankly, I don't use godit and termbox much anymore.

Me too. I'm vimmer. :) But godit is great. My friend was impressed and surprised when he saw godit for the first time.

nsf commented 9 years ago

Maybe one day termbox will work fine on all locales. Right now I don't think it's realistic (even if it happens to work in some cases). Closing the pull request. As for godit, let's leave it as is for now.