On Sun, Aug 9, 2015 at 9:11 PM, Karthik Nayak wrote:
> Add strbuf_utf8_align() which will align a given string into a strbuf
> as per given align_type and width. If the width is greater than the
> string length then no alignment is performed.
I smell an opportunity to reuse this code and kill som
Eric Sunshine writes:
> Please extend this documentation to state explicitly that this
> function preserves (does not truncate) the input string if it is wider
> than 'width'. That's quite important information for the caller to
> know.
>
> (Aside: I could easily see this function being extended
On Fri, Aug 14, 2015 at 12:38 AM, Eric Sunshine wrote:
> On Sun, Aug 9, 2015 at 10:11 AM, Karthik Nayak wrote:
>> Add strbuf_utf8_align() which will align a given string into a strbuf
>> as per given align_type and width. If the width is greater than the
>> string length then no alignment is perf
On Sun, Aug 9, 2015 at 10:11 AM, Karthik Nayak wrote:
> Add strbuf_utf8_align() which will align a given string into a strbuf
> as per given align_type and width. If the width is greater than the
> string length then no alignment is performed.
In addition to Junio's valuable comments...
> Signed
On Wed, Aug 12, 2015 at 10:10 PM, Junio C Hamano wrote:
> Karthik Nayak writes:
>
>> On Tue, Aug 11, 2015 at 11:52 PM, Junio C Hamano wrote:
>>> Karthik Nayak writes:
>>>
+void strbuf_utf8_align(struct strbuf *buf, align_type position, unsigned
int width,
+co
Karthik Nayak writes:
> On Tue, Aug 11, 2015 at 11:52 PM, Junio C Hamano wrote:
>> Karthik Nayak writes:
>>
>>> +void strbuf_utf8_align(struct strbuf *buf, align_type position, unsigned
>>> int width,
>>> +const char *s)
>>> +{
>>> + int display_len = utf8_strnwidth(s,
On Tue, Aug 11, 2015 at 11:52 PM, Junio C Hamano wrote:
> Karthik Nayak writes:
>
>> +void strbuf_utf8_align(struct strbuf *buf, align_type position, unsigned
>> int width,
>> +const char *s)
>> +{
>> + int display_len = utf8_strnwidth(s, strlen(s), 0);
>> + int utf8_
Karthik Nayak writes:
> +void strbuf_utf8_align(struct strbuf *buf, align_type position, unsigned int
> width,
> +const char *s)
> +{
> + int display_len = utf8_strnwidth(s, strlen(s), 0);
> + int utf8_compenstation = strlen(s) - display_len;
compensation, perhaps?
Add strbuf_utf8_align() which will align a given string into a strbuf
as per given align_type and width. If the width is greater than the
string length then no alignment is performed.
Helped-by: Eric Sunshine
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
9 matches
Mail list logo