source: patches/readline-6.0-branch_update-2.patch @ 25e84be

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 25e84be was 25e84be, checked in by Jonathan Norman <nate@…>, 14 years ago

updated readline patch to -2

  • Property mode set to 100644
File size: 4.3 KB
RevLine 
[25e84be]1Submitted By: Jonathan Norman (jonathan at bluesquarelinux.co.uk)
2Date: 2009-12-31
3Initial Package Version: 6.0
[613a326]4Origin: Upstream
5Upstream Status: Applied
[25e84be]6Description: Contains all upstream patches up to 6.0-004
[613a326]7
8diff -Naur readline-6.0.orig/display.c readline-6.0/display.c
[25e84be]9--- readline-6.0.orig/display.c 2009-12-31 18:52:45.000000000 +0000
10+++ readline-6.0/display.c      2009-12-31 19:05:02.000000000 +0000
[613a326]11@@ -512,6 +512,7 @@
12   /* Block keyboard interrupts because this function manipulates global
13      data structures. */
14   _rl_block_sigint (); 
15+  RL_SETSTATE (RL_STATE_REDISPLAYING);
16 
17   if (!rl_display_prompt)
18     rl_display_prompt = "";
[25e84be]19@@ -1191,6 +1192,8 @@
20       if (!rl_display_fixed || forced_display || lmargin != last_lmargin)
21        {
22          forced_display = 0;
23+         o_cpos = _rl_last_c_pos;
24+         cpos_adjusted = 0;
25          update_line (&visible_line[last_lmargin],
26                       &invisible_line[lmargin],
27                       0,
28@@ -1198,6 +1201,13 @@
29                       _rl_screenwidth + (lmargin ? 0 : wrap_offset),
30                       0);
31 
32+         if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
33+             cpos_adjusted == 0 &&
34+             _rl_last_c_pos != o_cpos &&
35+             _rl_last_c_pos > wrap_offset &&
36+             o_cpos < prompt_last_invisible)
37+               _rl_last_c_pos -= prompt_invis_chars_first_line;        /* XXX - was wrap_offset */
38+
39          /* If the visible new line is shorter than the old, but the number
40             of invisible characters is greater, and we are at the end of
41             the new line, we need to clear to eol. */
42@@ -1236,6 +1246,7 @@
[613a326]43       visible_wrap_offset = wrap_offset;
44   }
45 
46+  RL_UNSETSTATE (RL_STATE_REDISPLAYING);
47   _rl_release_sigint ();
48 }
49 
[25e84be]50@@ -1772,7 +1783,7 @@
[613a326]51             space_to_eol will insert too many spaces.  XXX - maybe we should
52             adjust col_lendiff based on the difference between _rl_last_c_pos
53             and _rl_screenwidth */
54-         if (col_lendiff && (_rl_last_c_pos < _rl_screenwidth))
55+         if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth)))
56 #endif
57            {     
58              if (_rl_term_autowrap && current_line < inv_botlin)
[25e84be]59@@ -1892,6 +1903,10 @@
[613a326]60 
61   woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
62   cpos = _rl_last_c_pos;
63+
64+  if (cpos == 0 && cpos == new)
65+    return;
66+
67 #if defined (HANDLE_MULTIBYTE)
68   /* If we have multibyte characters, NEW is indexed by the buffer point in
69      a multibyte string, but _rl_last_c_pos is the display position.  In
[25e84be]70@@ -1905,9 +1920,9 @@
[613a326]71         prompt string, since they're both buffer indices and DPOS is a
72         desired display position. */
73       if ((new > prompt_last_invisible) ||             /* XXX - don't use woff here */
74-         (prompt_physical_chars > _rl_screenwidth &&
75+         (prompt_physical_chars >= _rl_screenwidth &&
76           _rl_last_v_pos == prompt_last_screen_line &&
77-          wrap_offset >= woff &&
78+          wrap_offset >= woff && dpos >= woff &&
79           new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset)))
80           /* XXX last comparison might need to be >= */
81        {
82diff -Naur readline-6.0.orig/patchlevel readline-6.0/patchlevel
[25e84be]83--- readline-6.0.orig/patchlevel        2009-12-31 18:52:45.000000000 +0000
84+++ readline-6.0/patchlevel     2009-12-31 18:58:11.000000000 +0000
[613a326]85@@ -1,3 +1,3 @@
86 # Do not edit -- exists only for use by patch
87 
88-0
89+3
90diff -Naur readline-6.0.orig/readline.h readline-6.0/readline.h
[25e84be]91--- readline-6.0.orig/readline.h        2009-12-31 18:52:45.000000000 +0000
92+++ readline-6.0/readline.h     2009-12-31 18:58:11.000000000 +0000
[613a326]93@@ -814,8 +814,9 @@
94 #define RL_STATE_VIMOTION      0x100000        /* reading vi motion arg */
95 #define RL_STATE_MULTIKEY      0x200000        /* reading multiple-key command */
96 #define RL_STATE_VICMDONCE     0x400000        /* entered vi command mode at least once */
97+#define RL_STATE_REDISPLAYING  0x800000        /* updating terminal display */
98 
99-#define RL_STATE_DONE          0x800000        /* done; accepted line */
100+#define RL_STATE_DONE          0x1000000       /* done; accepted line */
101 
102 #define RL_SETSTATE(x)         (rl_readline_state |= (x))
103 #define RL_UNSETSTATE(x)       (rl_readline_state &= ~(x))
104diff -Naur readline-6.0.orig/terminal.c readline-6.0/terminal.c
[25e84be]105--- readline-6.0.orig/terminal.c        2009-12-31 18:52:45.000000000 +0000
106+++ readline-6.0/terminal.c     2009-12-31 18:58:11.000000000 +0000
[613a326]107@@ -355,7 +355,7 @@
108       _rl_get_screen_size (fileno (rl_instream), 1);
109       if (CUSTOM_REDISPLAY_FUNC ())
110        rl_forced_update_display ();
111-      else
112+      else if (RL_ISSTATE(RL_STATE_REDISPLAYING) == 0)
113        _rl_redisplay_after_sigwinch ();
114     }
115 }
Note: See TracBrowser for help on using the repository browser.