Mercurial > vim
comparison src/libvterm/src/termscreen.c @ 18064:8b4f9be5db73 v8.1.2027
patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Commit: https://github.com/vim/vim/commit/57da69816872d53038e8a7e8dd4dc39a31192f0d
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 13 22:30:11 2019 +0200
patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Problem: MS-Windows: problem with ambiwidth characters.
Solution: handle ambiguous width characters in ConPTY on Windows 10 (1903).
(Nobuhiro Takasaki, closes #4411)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 13 Sep 2019 22:45:04 +0200 |
parents | 811a12a78164 |
children | 9c3347b21b89 |
comparison
equal
deleted
inserted
replaced
18063:168f1eca04a2 | 18064:8b4f9be5db73 |
---|---|
768 cell->attrs.dhl = intcell->pen.dhl; | 768 cell->attrs.dhl = intcell->pen.dhl; |
769 | 769 |
770 cell->fg = intcell->pen.fg; | 770 cell->fg = intcell->pen.fg; |
771 cell->bg = intcell->pen.bg; | 771 cell->bg = intcell->pen.bg; |
772 | 772 |
773 if(pos.col < (screen->cols - 1) && | 773 if(vterm_get_special_pty_type() == 2) { |
774 getcell(screen, pos.row, pos.col + 1)->chars[0] == (uint32_t)-1) | 774 /* Get correct cell width from cell information contained in line buffer */ |
775 cell->width = 2; | 775 if(pos.col < (screen->cols - 1) && |
776 else | 776 getcell(screen, pos.row, pos.col + 1)->chars[0] == (uint32_t)-1) { |
777 cell->width = 1; | 777 if(getcell(screen, pos.row, pos.col)->chars[0] == 0x20) { |
778 getcell(screen, pos.row, pos.col)->chars[0] = 0; | |
779 cell->width = 2; | |
780 } else if(getcell(screen, pos.row, pos.col)->chars[0] == 0) { | |
781 getcell(screen, pos.row, pos.col + 1)->chars[0] = 0; | |
782 cell->width = 1; | |
783 } else { | |
784 cell->width = 2; | |
785 } | |
786 } else | |
787 cell->width = 1; | |
788 } else { | |
789 if(pos.col < (screen->cols - 1) && | |
790 getcell(screen, pos.row, pos.col + 1)->chars[0] == (uint32_t)-1) | |
791 cell->width = 2; | |
792 else | |
793 cell->width = 1; | |
794 } | |
778 | 795 |
779 return 1; | 796 return 1; |
780 } | 797 } |
781 | 798 |
782 // Copy external to internal representation of a screen cell | 799 // Copy external to internal representation of a screen cell |