Deleted Added
full compact
1d0
< /* $FreeBSD: head/contrib/libreadline/terminal.c 75409 2001-04-11 03:15:56Z ache $ */
22a22
> /* $FreeBSD: head/contrib/libreadline/terminal.c 119614 2003-08-31 18:29:38Z ache $ */
67a68
> #include "xmalloc.h"
68a70,72
> #define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay)
> #define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc)
>
142a147
> static char *_rl_term_at7; /* @7 */
143a149,157
> /* Insert key */
> static char *_rl_term_kI;
>
> /* Cursor control */
> static char *_rl_term_vs; /* very visible */
> static char *_rl_term_ve; /* normal */
>
> static void bind_termcap_arrow_keys PARAMS((Keymap));
>
277c291,294
< _rl_redisplay_after_sigwinch ();
---
> if (CUSTOM_REDISPLAY_FUNC ())
> rl_forced_update_display ();
> else
> _rl_redisplay_after_sigwinch ();
289a307
> { "@7", &_rl_term_at7 },
298a317,318
> { "kH", &_rl_term_kH }, /* home down ?? */
> { "kI", &_rl_term_kI }, /* insert */
299a320
> { "ke", &_rl_term_ke }, /* end keypad mode */
301d321
< { "@7", &_rl_term_kH }, /* end */
303a324
> { "ks", &_rl_term_ks }, /* start keypad mode */
305,306d325
< { "ks", &_rl_term_ks },
< { "ke", &_rl_term_ke },
315a335,336
> { "vs", &_rl_term_vs },
> { "ve", &_rl_term_ve },
329a351,353
> # ifdef __LCC__
> *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
> # else
330a355
> # endif
335,337d359
< #define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay)
< #define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc)
<
345d366
< Keymap xkeymap;
365c386
< term_string_buffer = xmalloc(2032);
---
> term_string_buffer = (char *)xmalloc(2032);
368c389
< term_buffer = xmalloc(4080);
---
> term_buffer = (char *)xmalloc(4080);
402a424,425
> _rl_term_kh = _rl_term_kH = _rl_term_kI = (char *)NULL;
> _rl_term_ks = _rl_term_ke = _rl_term_at7 = (char *)NULL;
403a427
> _rl_term_ve = _rl_term_vs = (char *)NULL;
448d471
< xkeymap = _rl_keymap;
450,454c473
< _rl_keymap = emacs_standard_keymap;
< _rl_bind_if_unbound (_rl_term_ku, rl_get_previous_history);
< _rl_bind_if_unbound (_rl_term_kd, rl_get_next_history);
< _rl_bind_if_unbound (_rl_term_kr, rl_forward);
< _rl_bind_if_unbound (_rl_term_kl, rl_backward);
---
> bind_termcap_arrow_keys (emacs_standard_keymap);
456,458d474
< _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line); /* Home */
< _rl_bind_if_unbound (_rl_term_kH, rl_end_of_line); /* End */
<
460c476,492
< _rl_keymap = vi_movement_keymap;
---
> bind_termcap_arrow_keys (vi_movement_keymap);
> bind_termcap_arrow_keys (vi_insertion_keymap);
> #endif /* VI_MODE */
>
> return 0;
> }
>
> /* Bind the arrow key sequences from the termcap description in MAP. */
> static void
> bind_termcap_arrow_keys (map)
> Keymap map;
> {
> Keymap xkeymap;
>
> xkeymap = _rl_keymap;
> _rl_keymap = map;
>
467,468c499
< _rl_bind_if_unbound (_rl_term_kH, rl_end_of_line); /* End */
< #endif /* VI_MODE */
---
> _rl_bind_if_unbound (_rl_term_at7, rl_end_of_line); /* End */
471,472d501
<
< return 0;
608a638,663
>
> /* **************************************************************** */
> /* */
> /* Controlling the Cursor */
> /* */
> /* **************************************************************** */
>
> /* Set the cursor appropriately depending on IM, which is one of the
> insert modes (insert or overwrite). Insert mode gets the normal
> cursor. Overwrite mode gets a very visible cursor. Only does
> anything if we have both capabilities. */
> void
> _rl_set_cursor (im, force)
> int im, force;
> {
> if (_rl_term_ve && _rl_term_vs)
> {
> if (force || im != rl_insert_mode)
> {
> if (im == RL_IM_OVERWRITE)
> tputs (_rl_term_vs, 1, _rl_output_character_function);
> else
> tputs (_rl_term_ve, 1, _rl_output_character_function);
> }
> }
> }