Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 1566:d64e0b2855fc
Fix display of last character in the input line when Aspell support is enabled
The rightmost character displayed in the input line was always the last
character of the line. (Reported by isbear.)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 08 Feb 2009 10:08:05 +0100 |
parents | c1d0f906d379 |
children | ece4f26bf9ff |
comparison
equal
deleted
inserted
replaced
1565:bff9633e38ee | 1566:d64e0b2855fc |
---|---|
3581 // prints inputLine with underlined words when misspelled | 3581 // prints inputLine with underlined words when misspelled |
3582 static inline void print_checked_line(void) | 3582 static inline void print_checked_line(void) |
3583 { | 3583 { |
3584 char *wprint_char_fmt = "%c"; | 3584 char *wprint_char_fmt = "%c"; |
3585 int point; | 3585 int point; |
3586 int nrchar = maxX; | |
3586 char *ptrCur = inputLine + inputline_offset; | 3587 char *ptrCur = inputLine + inputline_offset; |
3587 | 3588 |
3588 #ifdef UNICODE | 3589 #ifdef UNICODE |
3589 // We need this to display a single UTF-8 char... Any better solution? | 3590 // We need this to display a single UTF-8 char... Any better solution? |
3590 if (utf8_mode) | 3591 if (utf8_mode) |
3591 wprint_char_fmt = "%lc"; | 3592 wprint_char_fmt = "%lc"; |
3592 #endif | 3593 #endif |
3593 | 3594 |
3594 wmove(inputWnd, 0, 0); // problem with backspace | 3595 wmove(inputWnd, 0, 0); // problem with backspace |
3595 | 3596 |
3596 while (*ptrCur) { | 3597 while (*ptrCur && nrchar-- > 0) { |
3597 point = ptrCur - inputLine; | 3598 point = ptrCur - inputLine; |
3598 if (maskLine[point]) | 3599 if (maskLine[point]) |
3599 wattrset(inputWnd, A_UNDERLINE); | 3600 wattrset(inputWnd, A_UNDERLINE); |
3600 wprintw(inputWnd, wprint_char_fmt, get_char(ptrCur)); | 3601 wprintw(inputWnd, wprint_char_fmt, get_char(ptrCur)); |
3601 wattrset(inputWnd, A_NORMAL); | 3602 wattrset(inputWnd, A_NORMAL); |