readline52-010.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. READLINE PATCH REPORT
  2. =====================
  3. Readline-Release: 5.2
  4. Patch-ID: readline52-010
  5. Bug-Reported-by: Miroslav Lichvar <mlichvar@redhat.com>
  6. Bug-Reference-ID: Fri, 02 Nov 2007 14:07:45 +0100
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-11/msg00000.html
  8. Bug-Description:
  9. In certain cases when outputting characters at the end of the line,
  10. e.g., when displaying the prompt string, readline positions the cursor
  11. incorrectly if the prompt string contains invisible characters and the
  12. text being drawn begins before the last invisible character in the line.
  13. Patch:
  14. *** ../readline-5.2-patched/display.c 2007-08-25 13:47:08.000000000 -0400
  15. --- ./display.c 2007-11-10 17:51:29.000000000 -0500
  16. ***************
  17. *** 1566,1574 ****
  18. else
  19. {
  20. - /* We have horizontal scrolling and we are not inserting at
  21. - the end. We have invisible characters in this line. This
  22. - is a dumb update. */
  23. _rl_output_some_chars (nfd, temp);
  24. _rl_last_c_pos += col_temp;
  25. return;
  26. }
  27. --- 1619,1632 ----
  28. else
  29. {
  30. _rl_output_some_chars (nfd, temp);
  31. _rl_last_c_pos += col_temp;
  32. + /* If nfd begins before any invisible characters in the prompt,
  33. + adjust _rl_last_c_pos to account for wrap_offset and set
  34. + cpos_adjusted to let the caller know. */
  35. + if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
  36. + {
  37. + _rl_last_c_pos -= wrap_offset;
  38. + cpos_adjusted = 1;
  39. + }
  40. return;
  41. }