texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/xspara.c (xspara__add_next): Use


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/XS/xspara.c (xspara__add_next): Use wcwidth on each character, rather than assuming they all have display width 1. Faulty line breaking for DEL characters reported by Patrice.
Date: Thu, 18 Aug 2022 09:23:46 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 5ae3f7f82f * tp/Texinfo/XS/xspara.c (xspara__add_next): Use wcwidth on 
each character, rather than assuming they all have display width 1.  Faulty 
line breaking for DEL characters reported by Patrice.
5ae3f7f82f is described below

commit 5ae3f7f82f0abfdf8f5f2abf5c1ccaafdff7e8f0
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Thu Aug 18 14:23:38 2022 +0100

    * tp/Texinfo/XS/xspara.c (xspara__add_next):
    Use wcwidth on each character, rather than assuming they
    all have display width 1.  Faulty line breaking for DEL characters
    reported by Patrice.
---
 ChangeLog                                                    |  7 +++++++
 tp/Texinfo/XS/xspara.c                                       |  5 ++++-
 tp/t/results/converters_tests/empty_accent.pl                |  3 +--
 tp/t/results/info_tests/invalid_node_name_no_warning.pl      |  3 +--
 tp/t/results/info_tests/invalid_node_name_warning.pl         |  3 +--
 tp/t/results/plaintext_tests/del_quote_linebreaking.pl       |  3 +--
 tp/tests/layout/res_parser/formatting_info/formatting.info   | 12 ++++++------
 .../layout/res_parser/formatting_plaintext/formatting.txt    |  8 ++++----
 8 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7222c48bc6..eabed1bbac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-08-18  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/xspara.c (xspara__add_next):
+       Use wcwidth on each character, rather than assuming they
+       all have display width 1.  Faulty line breaking for DEL characters
+       reported by Patrice.
+
 2022-08-18  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * tp/t/plaintext_tests.t (del_quote_linebreaking):
diff --git a/tp/Texinfo/XS/xspara.c b/tp/Texinfo/XS/xspara.c
index 9b0f4bc15c..17f91fe755 100644
--- a/tp/Texinfo/XS/xspara.c
+++ b/tp/Texinfo/XS/xspara.c
@@ -716,10 +716,13 @@ xspara__add_next (TEXT *result, char *word, int word_len, 
int transparent)
 
       while (left > 0)
         {
+          int columns;
           int char_len = mbrtowc (&w, p, left, NULL);
           left -= char_len;
           p += char_len;
-          len++;
+          columns = wcwidth (w);
+          if (columns > 0)
+            len += columns;
         }
 
       state.word_counter += len;
diff --git a/tp/t/results/converters_tests/empty_accent.pl 
b/tp/t/results/converters_tests/empty_accent.pl
index 20ef634768..7f8fa4f410 100644
--- a/tp/t/results/converters_tests/empty_accent.pl
+++ b/tp/t/results/converters_tests/empty_accent.pl
@@ -64,8 +64,7 @@ $result_floats{'empty_accent'} = {};
 
 
 
-$result_converted{'plaintext'}->{'empty_accent'} = '̀
-';
+$result_converted{'plaintext'}->{'empty_accent'} = '̀';
 
 
 $result_converted{'html_text'}->{'empty_accent'} = '<p>&#768;
diff --git a/tp/t/results/info_tests/invalid_node_name_no_warning.pl 
b/tp/t/results/info_tests/invalid_node_name_no_warning.pl
index a72f0972bb..6044e4ab3a 100644
--- a/tp/t/results/info_tests/invalid_node_name_no_warning.pl
+++ b/tp/t/results/info_tests/invalid_node_name_no_warning.pl
@@ -1121,8 +1121,7 @@ File: ,  Node: node,comma,  Next: bidule:,  Prev: 
nodename. a,  Up: Top
 
 File: ,  Node: bidule:,  Prev: node,comma,  Up: Top
 
-*note truc:: nodename. a.  *note machin: node,comma.  *note
-bidule:::.
+*note truc:: nodename. a.  *note machin: node,comma.  *note bidule:::.
 
 
 Tag Table:
diff --git a/tp/t/results/info_tests/invalid_node_name_warning.pl 
b/tp/t/results/info_tests/invalid_node_name_warning.pl
index 2c9ad1fea0..5f353b809c 100644
--- a/tp/t/results/info_tests/invalid_node_name_warning.pl
+++ b/tp/t/results/info_tests/invalid_node_name_warning.pl
@@ -1121,8 +1121,7 @@ File: ,  Node: node,comma,  Next: bidule:,  Prev: 
nodename. a,  Up: Top
 
 File: ,  Node: bidule:,  Prev: node,comma,  Up: Top
 
-*note truc:: nodename. a.  *note machin: node,comma.  *note
-bidule:::.
+*note truc:: nodename. a.  *note machin: node,comma.  *note bidule:::.
 
 
 Tag Table:
diff --git a/tp/t/results/plaintext_tests/del_quote_linebreaking.pl 
b/tp/t/results/plaintext_tests/del_quote_linebreaking.pl
index fed3e2c20e..4b4c181caa 100644
--- a/tp/t/results/plaintext_tests/del_quote_linebreaking.pl
+++ b/tp/t/results/plaintext_tests/del_quote_linebreaking.pl
@@ -702,8 +702,7 @@ $result_converted{'plaintext'}->{'del_quote_linebreaking'} 
= 'first para
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx *Note
 (manual)no:de::
 
-   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx *Note
-(manual)no:de::
+   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx *Note (manual)no:de::
 
 ';
 
diff --git a/tp/tests/layout/res_parser/formatting_info/formatting.info 
b/tp/tests/layout/res_parser/formatting_info/formatting.info
index 970d0b8aad..415ef06dd8 100644
--- a/tp/tests/layout/res_parser/formatting_info/formatting.info
+++ b/tp/tests/layout/res_parser/formatting_info/formatting.info
@@ -62,8 +62,8 @@ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 
a a a a
 '@H{a}' a̋ '@H{--a}' -a̋ '@dotaccent{a}' ȧ '@dotaccent{--a}' -ȧ
 '@ringaccent{a}' å '@ringaccent{--a}' -å '@tieaccent{a}' a͡
 '@tieaccent{--a}' -a͡ '@u{a}' ă '@u{--a}' -ă '@ubaraccent{a}' a̲
-'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}'
-ǎ '@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
+'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}' ǎ
+'@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
 'a@sup{h}@sub{l}' a^{h}_{l} '@footnote{in footnote}' (1) '@footnote{in
 footnote2}' (2)
 
@@ -772,8 +772,8 @@ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 
a a a a a
 '@H{a}' a̋ '@H{--a}' -a̋ '@dotaccent{a}' ȧ '@dotaccent{--a}' -ȧ
 '@ringaccent{a}' å '@ringaccent{--a}' -å '@tieaccent{a}' a͡
 '@tieaccent{--a}' -a͡ '@u{a}' ă '@u{--a}' -ă '@ubaraccent{a}' a̲
-'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}'
-ǎ '@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
+'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}' ǎ
+'@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
 'a@sup{h}@sub{l}' a^{h}_{l} '@footnote{in footnote}' (1) '@footnote{in
 footnote2}' (2)
 
@@ -1439,8 +1439,8 @@ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 
a a a a a a
 '@H{a}' a̋ '@H{--a}' -a̋ '@dotaccent{a}' ȧ '@dotaccent{--a}' -ȧ
 '@ringaccent{a}' å '@ringaccent{--a}' -å '@tieaccent{a}' a͡
 '@tieaccent{--a}' -a͡ '@u{a}' ă '@u{--a}' -ă '@ubaraccent{a}' a̲
-'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}'
-ǎ '@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
+'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}' ǎ
+'@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
 'a@sup{h}@sub{l}' a^{h}_{l} '@footnote{in footnote}' (3) '@footnote{in
 footnote2}' (4)
 
diff --git a/tp/tests/layout/res_parser/formatting_plaintext/formatting.txt 
b/tp/tests/layout/res_parser/formatting_plaintext/formatting.txt
index c2dba8aa34..c646944ff4 100644
--- a/tp/tests/layout/res_parser/formatting_plaintext/formatting.txt
+++ b/tp/tests/layout/res_parser/formatting_plaintext/formatting.txt
@@ -75,8 +75,8 @@ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 
a a a a
 '@H{a}' a̋ '@H{--a}' -a̋ '@dotaccent{a}' ȧ '@dotaccent{--a}' -ȧ
 '@ringaccent{a}' å '@ringaccent{--a}' -å '@tieaccent{a}' a͡
 '@tieaccent{--a}' -a͡ '@u{a}' ă '@u{--a}' -ă '@ubaraccent{a}' a̲
-'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}'
-ǎ '@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
+'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}' ǎ
+'@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
 'a@sup{h}@sub{l}' a^{h}_{l} '@footnote{in footnote}' (1) '@footnote{in
 footnote2}' (2)
 
@@ -742,8 +742,8 @@ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a 
a a a a a
 '@H{a}' a̋ '@H{--a}' -a̋ '@dotaccent{a}' ȧ '@dotaccent{--a}' -ȧ
 '@ringaccent{a}' å '@ringaccent{--a}' -å '@tieaccent{a}' a͡
 '@tieaccent{--a}' -a͡ '@u{a}' ă '@u{--a}' -ă '@ubaraccent{a}' a̲
-'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}'
-ǎ '@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
+'@ubaraccent{--a}' -a̲ '@udotaccent{a}' ạ '@udotaccent{--a}' -ạ '@v{a}' ǎ
+'@v{--a}' -ǎ '@,{c}' ç '@,{--c}' -ç '@ogonek{a}' ą '@ogonek{--a}' -ą
 'a@sup{h}@sub{l}' a^{h}_{l} '@footnote{in footnote}' (3) '@footnote{in
 footnote2}' (4)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]