From: NeilBrown Date: Wed, 21 Jun 2023 07:03:14 +0000 (+1000) Subject: renderline: fix rendering bug when a TAB wraps. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=bd4153a0929188ed786c8b40b3814c32d7b43109;p=edlib.git renderline: fix rendering bug when a TAB wraps. If a tab wraps, we show the character immediately before the tab at the start of the next line, which is wrong. It is particularly weird when that char is the '>' at the end of an attribute marking. Signed-off-by: NeilBrown --- diff --git a/lib-renderline.c b/lib-renderline.c index bc4c2e0e..b14fc8c0 100644 --- a/lib-renderline.c +++ b/lib-renderline.c @@ -973,7 +973,9 @@ DEF_CMD(renderline) offset == (start - line_start) ? in_tab : -1, posx, scale); - if (w > 1) { + if (ret == WRAP) + ; + else if (w > 1) { line -= 1; in_tab = -1; // suppress extra cursors } else diff --git a/tests.d/01-c-mode b/tests.d/01-c-mode index 6d8a1814..b9dcfabb 100644 --- a/tests.d/01-c-mode +++ b/tests.d/01-c-mode @@ -226,39 +226,39 @@ Display 80,30 BF2B2E41ECED80F63E8C277399F91B32 64,15 Key ":C-E" Display 80,30 BF2B2E41ECED80F63E8C277399F91B32 73,15 Key ":C-D" -Display 80,30 636FABDEDE53D50C508FA20D07089AA1 2,16 +Display 80,30 D9E76FD71B6AFB6041BBF65D5183F1C1 73,15 Key ":C-P" -Display 80,30 2FD54A8010925442386FC29896E8D5EE 33,14 +Display 80,30 A9A37B8C0F8AD812E8AD314CD31F9390 33,14 Key ":C-N" -Display 80,30 636FABDEDE53D50C508FA20D07089AA1 2,16 +Display 80,30 D9E76FD71B6AFB6041BBF65D5183F1C1 73,15 Key "- " -Display 80,30 6A7486794CD1EEC67AE476A7814A808F 2,16 +Display 80,30 89EB08D821CBA43A36817F923BD5968B 74,15 Key ":C-F" -Display 80,30 6A7486794CD1EEC67AE476A7814A808F 4,16 +Display 80,30 89EB08D821CBA43A36817F923BD5968B 4,16 Key ":C-F" -Display 80,30 6A7486794CD1EEC67AE476A7814A808F 12,16 +Display 80,30 89EB08D821CBA43A36817F923BD5968B 12,16 Key ":C-B" -Display 80,30 6A7486794CD1EEC67AE476A7814A808F 4,16 +Display 80,30 89EB08D821CBA43A36817F923BD5968B 4,16 Key "- " -Display 80,30 6A7486794CD1EEC67AE476A7814A808F 5,16 +Display 80,30 89EB08D821CBA43A36817F923BD5968B 5,16 Key ":C-N" -Display 80,30 947EC3EEFBDD832F98B21416CB35B5DD 1,17 +Display 80,30 B0547491970366E201562D7F28ED0B90 1,17 Key ":C-X" -Display 80,30 6B61D58975698A5582B68BBBC9026797 1,17 +Display 80,30 9122476ED758FA5D460E26EAEE5523F9 1,17 Key ":C-F" -Display 80,30 F808AEE9DD437AB29FADB983CDBEDD93 49,13 +Display 80,30 483DDF4540DCE2248E314403A1BE13A1 49,13 Key "-c" -Display 80,30 E94304ADDAF9E251A3CFE5A01BB3ABC1 50,13 +Display 80,30 693BC85035CF68F003AA12505A54D6E1 50,13 Key "-o" -Display 80,30 E00E273B82E23E74D04B27B0E385BE6A 51,13 +Display 80,30 CA523C2576D5407B0E3424D7A023855B 51,13 Key "-r" -Display 80,30 CDC361B04B06FF0B562F876994DC8815 52,13 +Display 80,30 E98CA327F7E22D9167A0D4FAAF9509DB 52,13 Key "-e" -Display 80,30 D53D3F6FCBF1CB540A2F6AED37D912AE 53,13 +Display 80,30 C8C62D3B3FB9EA0BA973BE91F2CF372F 53,13 Key "-." -Display 80,30 80D486C79BAA7022603CF1A991A6B0FF 54,13 +Display 80,30 0C9E30FB5B22C4352A6189C360C54A87 54,13 Key "-h" -Display 80,30 3A36E4A38C9A6F6AFF95747B22D2CA59 55,13 +Display 80,30 D7DE062C476D5A23D9E546DA25BA4B7B 55,13 Key ":Enter" Display 80,30 619F6F8D8AF8613711B71F6A2CC8B2F9 1,0 Key ":A->"