HiTECNOLOGYs / cl-charms

More up-to-date version of cl-charms. Forked it because it was, apparently, abandoned by author and I couldn't contact him.
https://gitorious.org/cl-charms
Other
155 stars 29 forks source link

Can't write character in bottom right corner #24

Closed MatthewRock closed 8 years ago

MatthewRock commented 8 years ago

Well, it's all I can say. You can test it with CL-CHARMS example suite: just use charms-paint, go to te bottom right corner (pressing aw will get you there) and press space to try to leave a character. Boom, error. Not really sure what's causing it, but since it's connected with mvwaddchar, I'd try there, I guess.

stylewarning commented 8 years ago

Thanks for the report. I can reproduce it on Mac OS X 10.10.5 with recentish SBCL.

stylewarning commented 8 years ago

I think this is an aspect of curses itself. The addch* functions advance the cursor, and there's nothing to advance to at the end of the window, so it errors. I've pushed a commit which checks this specially by way of new high level INSERT-CHAR-* functions. Basically, when at the last position of a window, I opt to insert a character (a la the insert key on a keyboard) at the last position as opposed to writing it.

With this change, the Paint example works (although in my particular terminal emulator, there's a little weird artifact with the cursor advancing in the last position).

There are probably bugs of this nature related to writing a string that extends to the last position of the window, but that's probably for a separate issue and commit.