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: displayPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Sebastien Helleu <flashcode>Open/Closed: Closed
IRC nick: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 09 Feb 2014 09:52:55 AM UTCflashcodeOpen/ClosedOpen=>Closed
    Wed 11 Dec 2013 11:50:39 AM UTCflashcodeStatusNone=>Done
      Assigned toNone=>flashcode
    Wed 11 Dec 2013 09:17:36 AM UTCayanokouziAttached 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.1-cleanup