Quick filename search (^S) highlights correct width.
diff -Naur mc-4.6.2.orig/src/screen.c mc-4.6.2/src/screen.c
old
|
new
|
|
788 | 788 | |
789 | 789 | if (panel->searching){ |
790 | 790 | attrset (INPUT_COLOR); |
| 791 | #ifdef UTF8 |
| 792 | if (SLsmg_Is_Unicode) { |
| 793 | int j; |
| 794 | char search_buffer_valid_utf8 [sizeof (panel->search_buffer)]; |
| 795 | mbstate_t mbs; |
| 796 | int pos = 0; |
| 797 | int l = strlen (panel->search_buffer); |
| 798 | strcpy (search_buffer_valid_utf8, panel->search_buffer); |
| 799 | while (pos < l) { |
| 800 | memset (&mbs, 0, sizeof(mbs)); |
| 801 | j = mbrlen (search_buffer_valid_utf8 + pos, l - pos, &mbs); |
| 802 | if (j <= 0) break; |
| 803 | pos += j; |
| 804 | } |
| 805 | search_buffer_valid_utf8[pos] = '\0'; |
| 806 | j = columns_to_bytes (search_buffer_valid_utf8, panel->widget.cols-3); |
| 807 | tty_printf ("/%-*s", j, search_buffer_valid_utf8); |
| 808 | } else |
| 809 | #endif |
791 | 810 | tty_printf ("/%-*s", panel->widget.cols-3, panel->search_buffer); |
792 | 811 | attrset (NORMAL_COLOR); |
793 | 812 | return; |