patchWeeChat - Patches: patch #8253, fix highlighted position in string...

 
 

patch #8253: fix highlighted position in string with full-width chars

Submitted by:  AYANOKOUZI, Ryuunosuke <ayanokouzi>
Submitted on:  Wed 11 Dec 2013 09:17:36 AM UTC
 
Category:  Priority: 5 - Normal
Status:  Privacy: 
Assigned to: flashcode Open/Closed: Closed
IRC nick: 
Summary:  *
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
        No canned response available   (Or define a new Canned Response)

 

Wed 11 Dec 2013 12:35:29 PM UTC, comment #2: 

Hi FlashCode,

Thanks for quick reply.

I think your idea is better than mine. I also checked result with some
test-cases, it seems to work fine.

Regards,
AYANOKOUZI, Ryuunosuke
--
AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>

AYANOKOUZI, Ryuunosuke <ayanokouzi>
Wed 11 Dec 2013 11:50:39 AM UTC, comment #1: 

Thanks for the patch, it is committed.

I changed some things:
- use of only one function to not duplicate code, with new argument: "int use_screen_size", to use size on screen instead of number of chars,
- use of "use_screen_size" == 0 only in text emphasis (I'm not sure it was intentional in your patch to not use width any more in many calls to the function).

My tests were OK, but if you think something is wrong with these changes, please let me know.

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
Wed 11 Dec 2013 09:17:36 AM UTC, original submission:  

Hi,

When highlighting a word in string containing full-width chars ahead
of the search word, wrong position is highlighted.

This is a patch for this bug.

This bug is caused by position counting error in
"gui_chat_string_real_pos" function.  According to the source of
"gui_color_emphasize" function, argument "pos" for function
"gui_chat_string_real_pos" is expected to be a number of UTF-8 chars,
but inside "gui_chat_string_real_pos" function, argument "pos" is
treated as the width of string on screen. So, if argument "string"
doesn't contain full-width chars, it's always fine. But if there is
full-width char ahead of search word, wrong position is highlighted.

Please find attached files (testcase.png,
0001-fix-highlighted-position-in-string-with-full-width-c.patch).

Regards,
AYANOKOUZI, Ryuunosuke
--
AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>

AYANOKOUZI, Ryuunosuke <ayanokouzi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #29859:  testcase.png added by ayanokouzi (51KiB - image/png)

 

Search an item (to fill a dependency against):
   
Of     of  

Depends on the following items: None found

Items that depend on this one: None found

 

(Note: for Savannah users, you can use their login name rather than their email addresses.)


      

   

Carbon-Copy List
  • -email is unavailable- added by flashcode (Posted a comment)
  • -email is unavailable- added by ayanokouzi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


        / 100 remaining votes

     

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-09 flashcode Open/ClosedOpen => Closed
    2013-12-11 flashcode StatusNone => Done
        Assigned toNone => flashcode
    2013-12-11 ayanokouzi Attached File- => Added testcase.png, #29859
        Attached File- => Added 0001-fix-highlighted-position-in-string-with-full-width-c.patch, #29860

    Back to the top


    Powered by Savane 3.5