Mercurial > vim
comparison src/option.c @ 1941:d92358c7d621 v7.2.238
updated for version 7.2-238
author | vimboss |
---|---|
date | Wed, 22 Jul 2009 12:28:17 +0000 |
parents | afbe4a4c884c |
children | 9d6a886aceb2 |
comparison
equal
deleted
inserted
replaced
1940:e753954c86e2 | 1941:d92358c7d621 |
---|---|
401 */ | 401 */ |
402 #define P_BOOL 0x01 /* the option is boolean */ | 402 #define P_BOOL 0x01 /* the option is boolean */ |
403 #define P_NUM 0x02 /* the option is numeric */ | 403 #define P_NUM 0x02 /* the option is numeric */ |
404 #define P_STRING 0x04 /* the option is a string */ | 404 #define P_STRING 0x04 /* the option is a string */ |
405 #define P_ALLOCED 0x08 /* the string option is in allocated memory, | 405 #define P_ALLOCED 0x08 /* the string option is in allocated memory, |
406 must use vim_free() when assigning new | 406 must use free_string_option() when |
407 value. Not set if default is the same. */ | 407 assigning new value. Not set if default is |
408 the same. */ | |
408 #define P_EXPAND 0x10 /* environment expansion. NOTE: P_EXPAND can | 409 #define P_EXPAND 0x10 /* environment expansion. NOTE: P_EXPAND can |
409 never be used for local or hidden options! */ | 410 never be used for local or hidden options! */ |
410 #define P_NODEFAULT 0x40 /* don't set to default value */ | 411 #define P_NODEFAULT 0x40 /* don't set to default value */ |
411 #define P_DEF_ALLOCED 0x80 /* default value is in allocated memory, must | 412 #define P_DEF_ALLOCED 0x80 /* default value is in allocated memory, must |
412 use vim_free() when assigning new value */ | 413 use vim_free() when assigning new value */ |
8925 } | 8926 } |
8926 clear_termcodes(); | 8927 clear_termcodes(); |
8927 } | 8928 } |
8928 | 8929 |
8929 /* | 8930 /* |
8931 * Free the string for one term option, if it was allocated. | |
8932 * Set the string to empty_option and clear allocated flag. | |
8933 * "var" points to the option value. | |
8934 */ | |
8935 void | |
8936 free_one_termoption(var) | |
8937 char_u *var; | |
8938 { | |
8939 struct vimoption *p; | |
8940 | |
8941 for (p = &options[0]; p->fullname != NULL; p++) | |
8942 if (p->var == var) | |
8943 { | |
8944 if (p->flags & P_ALLOCED) | |
8945 free_string_option(*(char_u **)(p->var)); | |
8946 *(char_u **)(p->var) = empty_option; | |
8947 p->flags &= ~P_ALLOCED; | |
8948 break; | |
8949 } | |
8950 } | |
8951 | |
8952 /* | |
8930 * Set the terminal option defaults to the current value. | 8953 * Set the terminal option defaults to the current value. |
8931 * Used after setting the terminal name. | 8954 * Used after setting the terminal name. |
8932 */ | 8955 */ |
8933 void | 8956 void |
8934 set_term_defaults() | 8957 set_term_defaults() |