comparison src/term.c @ 859:99305c4c42d4

updated for version 7.0g02
author vimboss
date Wed, 03 May 2006 21:26:49 +0000
parents 2af8de31a3a8
children 77f8a648d2e6
comparison
equal deleted inserted replaced
858:ca82de29ac19 859:99305c4c42d4
4943 * CTRL-V characters are removed. When "from_part" is TRUE, a trailing CTRL-V 4943 * CTRL-V characters are removed. When "from_part" is TRUE, a trailing CTRL-V
4944 * is included, otherwise it is removed (for ":map xx ^V", maps xx to 4944 * is included, otherwise it is removed (for ":map xx ^V", maps xx to
4945 * nothing). When 'cpoptions' does not contain 'B', a backslash can be used 4945 * nothing). When 'cpoptions' does not contain 'B', a backslash can be used
4946 * instead of a CTRL-V. 4946 * instead of a CTRL-V.
4947 */ 4947 */
4948 char_u * 4948 char_u *
4949 replace_termcodes(from, bufp, from_part, do_lt) 4949 replace_termcodes(from, bufp, from_part, do_lt, special)
4950 char_u *from; 4950 char_u *from;
4951 char_u **bufp; 4951 char_u **bufp;
4952 int from_part; 4952 int from_part;
4953 int do_lt; /* also translate <lt> */ 4953 int do_lt; /* also translate <lt> */
4954 int special; /* always accept <key> notation */
4954 { 4955 {
4955 int i; 4956 int i;
4956 int slen; 4957 int slen;
4957 int key; 4958 int key;
4958 int dlen = 0; 4959 int dlen = 0;
4961 int do_special; /* recognize <> key codes */ 4962 int do_special; /* recognize <> key codes */
4962 int do_key_code; /* recognize raw key codes */ 4963 int do_key_code; /* recognize raw key codes */
4963 char_u *result; /* buffer for resulting string */ 4964 char_u *result; /* buffer for resulting string */
4964 4965
4965 do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL); 4966 do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
4966 do_special = (vim_strchr(p_cpo, CPO_SPECI) == NULL); 4967 do_special = (vim_strchr(p_cpo, CPO_SPECI) == NULL) || special;
4967 do_key_code = (vim_strchr(p_cpo, CPO_KEYCODE) == NULL); 4968 do_key_code = (vim_strchr(p_cpo, CPO_KEYCODE) == NULL);
4968 4969
4969 /* 4970 /*
4970 * Allocate space for the translation. Worst case a single character is 4971 * Allocate space for the translation. Worst case a single character is
4971 * replaced by 6 bytes (shifted special key), plus a NUL at the end. 4972 * replaced by 6 bytes (shifted special key), plus a NUL at the end.