1. 18 Feb, 2017 1 commit
    • Nelson Benítez León's avatar
      textiter: fix bug in gtk_text_iter_backward_line() · c4874aea
      Nelson Benítez León authored
      gtk_text_iter_backward_line() checks the value of
      real->line_char_offset without previously calling
      ensure_char_offsets (real) to make sure the former
      is up-to-date.
      As a consequence of this, when gtk_text_iter_backward_line()
      is called after a gtk_text_buffer_insert_range() in the
      first line of buffer, the iter is not moved to the start of
      the line, and the return value is wrong.
      Fixed by adding the ensure_char_offsets() call.
      A test case for this bug is added to the textiter gtk testsuite.
  2. 26 Feb, 2016 1 commit
  3. 08 Dec, 2015 2 commits
  4. 30 Nov, 2015 1 commit
    • Sébastien Wilmet's avatar
      textiter: fix bug in case insensitive backward search · 1a8f3e24
      Sébastien Wilmet authored
      'win.lines' contains the same content as the GtkTextBuffer, so to find
      @match_start, forward_chars_with_skipping() is called with
      skip_decomp=FALSE (the last parameter). So far so good.
      On the other hand, the content 'lines' (the needle split in lines) is
      casefolded and normalized for a case insensitive search. So,
      forward_chars_with_skipping(..., skip_decomp=TRUE) must be called only
      for the portion of text containing the needle.
      Since 'start_tmp' contains the location at the start of the match, we
      can simply begin at that location to find the end of the match.
      Unit tests are added.
  5. 16 Oct, 2015 1 commit
  6. 07 Oct, 2015 1 commit
    • Sébastien Wilmet's avatar
      textiter: fix bug in _gtk_text_btree_get_iter_at_last_toggle() · b23eabbd
      Sébastien Wilmet authored
      If the last tag toggle is the end iter, the function returned the wrong
      tag toggle.
      This resulted in some bugs where the view wasn't relayout/redrawn
      The function also always returned TRUE, probably because the return
      value is used nowhere. But for consistency with
      _gtk_text_btree_get_iter_at_first_toggle(), it's better to keep the
      return value, and also because otherwise the function would be wrong (it
      doesn't always return a tag toggle, if there is none).
  7. 09 Sep, 2015 1 commit
    • Matthias Clasen's avatar
      Clean up debug features · 3526b08e
      Matthias Clasen authored
      Introduce a GTK_DEBUG_CHECK() macro and use it to check for
      GTK_DEBUG flags everywhere. Also guard all such places by
  8. 06 Dec, 2014 1 commit
  9. 21 Aug, 2014 1 commit
    • Sébastien Wilmet's avatar
      Simplify _gtk_text_buffer_get_line_log_attrs() · 706c8e9c
      Sébastien Wilmet authored
      NULL was returned in case of an empty last line. Every users needed to
      special-case this. Now it will return the expected result: char_len of 0
      with one PangoLogAttr.
      In compute_log_attrs(), 'paragraph' will be the empty string "" with
      'char_len' == 0.
      pango_get_log_attrs() works fine with an empty string, it will return
      one correct PangoLogAttr (because there is one text position for the
      empty string).
      It fixes the unit tests for gtk_text_iter_is_cursor_position().
  10. 20 Aug, 2014 1 commit
    • Sébastien Wilmet's avatar
      GtkTextView: various code clean-ups · f39d2110
      Sébastien Wilmet authored
      - only one blank line is enough to separate code sections.
      - the 'signals' variable was in the middle of function prototypes.
      - compare pointers to NULL in some conditions ("if(blah) should be used
        only if blah is a boolean variable). It makes the code clearer.
      - various other things.
  11. 16 Aug, 2014 1 commit
  12. 31 Jul, 2014 1 commit
  13. 17 Jul, 2014 5 commits
  14. 13 Jul, 2014 2 commits
    • Sébastien Wilmet's avatar
      textiter: small optimization for find_by_log_attrs() · 472fd9a7
      Sébastien Wilmet authored
      Use gtk_text_iter_set_line_offset (&tmp_iter, 0) instead of
      gtk_text_iter_get_line(). The difference should not be big. In the first
      case the line doesn't need to be traversed thanks to the offset 0. For
      get_line(), the btree must be traversed.
      A temporary iter is needed to not break the behavior. But the behavior
      is quite strange, the function works directly on the iter passed as an
      argument to the function, even if the function returns FALSE (not
      found). So maybe a later commit will fix this strange behavior.
    • Sébastien Wilmet's avatar
      textiter: remove recursivity of find_by_log_attrs() · 7f6ae622
      Sébastien Wilmet authored
      find_by_log_attrs() was a recursive function. It is replaced by an
      The already_moved_initially parameter was TRUE only for the recursive
      call, so the paramater is removed.
      There is also a small cleanup of the find_visible_by_log_attrs()
      (remove trailing spaces, fix indentation).
      There is still a part to optimize for a later commit.
  15. 28 May, 2014 1 commit
  16. 13 Apr, 2014 1 commit
    • Sébastien Wilmet's avatar
      doc: improve documentation of gtk_text_iter_inside_word() · 22ce03fd
      Sébastien Wilmet authored
      There is a possible confusion with the sentence:
      "@iter is inside a natural-language word"
      The iter should be viewed here as the pointed character (i.e. on the
      right of the iter), not as a position between two characters.
      Instead of improving the documentation, another solution would have been
      to change the implementation so it is interpreted as an iter position
      inside a word, i.e. between two characters that are part of a
      natural-language word. But maybe some applications rely on the current
  17. 19 Feb, 2014 1 commit
  18. 07 Feb, 2014 5 commits
  19. 05 Feb, 2014 1 commit
  20. 04 Feb, 2014 1 commit
  21. 28 Jan, 2014 2 commits
  22. 30 Jun, 2013 1 commit
  23. 29 Jun, 2013 1 commit
  24. 25 Jun, 2013 1 commit
  25. 24 Jun, 2013 1 commit
    • Sébastien Wilmet's avatar
      textiter: bug fix in forward_search() and backward_search() · ea4e88df
      Sébastien Wilmet authored
      When the search is case sensitive, g_utf8_normalize() is not called, so
      the skip_decomp argument of the function forward_chars_with_skipping()
      must be FALSE.
      To verify that, when searching "éb", the count parameter of
      forward_chars_with_skipping() have a different value:
      - case sensitive: count = 2
      - case insensitive: count = 3 (g_utf8_normalize() has been called)
      The commit adds unit tests that didn't pass before, and that now pass
      (without known regression, obviously).
  26. 20 Jun, 2013 2 commits
  27. 16 Mar, 2013 1 commit
    • Sébastien Wilmet's avatar
      Small API doc fixes · 66dfab0b
      Sébastien Wilmet authored
      For gtk_text_iter_get_char(), due to the "Returns" at the beginning of
      the description, the description was not visible. So the first sentence
      has been reworded.
  28. 13 Apr, 2012 1 commit