Create pidgin_text_buffer API for working with GtkTextBuffers

Review Request #2754 — Created Oct. 30, 2023 and submitted

Information

pidgin/pidgin
default

Reviewers

Currently we only implement _get_html and _get_html_range and only a subset of
html tags are identified properly. This was intentional as it's easy to add
additional tags and because we're also introducing testing to Pidgin in this
commit.

Ran the unit tests under valgrind without issues.

Summary ID
Create pidgin_text_buffer API for working with GtkTextBuffers
Currently we only implement _get_html and _get_html_range and only a subset of html tags are identified properly. This was intentional as it's easy to add additional tags and because we're also introducing testing to Pidgin in this commit.
12e09c3c44bdb04e36f4758d0ad3921b60c2ab16
Description From Last Updated

Normally GtkTextIter is intended to be allocated on the stack (no *.)

QuLogicQuLogic

And then copies are just position = *start; next = *start;. (See docs of gtk_text_iter_copy.)

QuLogicQuLogic

Not talkatu.

QuLogicQuLogic

Usually Python3 would be 4-space indent.

QuLogicQuLogic

Extra space before =.

QuLogicQuLogic

Not sure I understand the comment, as you still use markup as the expected result?

QuLogicQuLogic

So it doesn't seem like end/real_end are used after this?

QuLogicQuLogic
QuLogic
  1. 
      
  2. pidgin/pidgintextbuffer.c (Diff revision 1)
     
     
     
    Show all issues

    Normally GtkTextIter is intended to be allocated on the stack (no *.)

    1. The intent was that I wanted copies of the passed in ones, but I should I can copy by value them...

  3. pidgin/pidgintextbuffer.c (Diff revision 1)
     
     
     
    Show all issues

    And then copies are just position = *start; next = *start;. (See docs of gtk_text_iter_copy.)

  4. pidgin/tests/test-wrapper.py (Diff revision 1)
     
     
     
    Show all issues

    Not talkatu.

  5. pidgin/tests/test-wrapper.py (Diff revision 1)
     
     
    Show all issues

    Usually Python3 would be 4-space indent.

  6. pidgin/tests/test-wrapper.py (Diff revision 1)
     
     
    Show all issues

    Extra space before =.

  7. pidgin/tests/test_text_buffer.c (Diff revision 1)
     
     
     
     
    Show all issues

    Not sure I understand the comment, as you still use markup as the expected result?

    1. This was supposed to be deleted.

  8. 
      
grim
QuLogic
  1. 
      
  2. pidgin/pidgintextbuffer.c (Diff revision 2)
     
     
     
    Show all issues

    So it doesn't seem like end/real_end are used after this?

  3. 
      
grim
QuLogic
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed