Mercurial > vim
comparison src/evalfunc.c @ 13262:69278c25429d v8.0.1505
patch 8.0.1505: debugger can't break on a condition
commit https://github.com/vim/vim/commit/c6f9f739d32084923c3031cbf6f581f8c8bf7fd2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 11 19:06:26 2018 +0100
patch 8.0.1505: debugger can't break on a condition
Problem: Debugger can't break on a condition. (Charles Campbell)
Solution: Add ":breakadd expr". (Christian Brabandt, closes https://github.com/vim/vim/issues/859)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 11 Feb 2018 19:15:05 +0100 |
parents | 5958573d8a72 |
children | abaebba89fd4 |
comparison
equal
deleted
inserted
replaced
13261:fa53b212be26 | 13262:69278c25429d |
---|---|
2989 */ | 2989 */ |
2990 static void | 2990 static void |
2991 f_exists(typval_T *argvars, typval_T *rettv) | 2991 f_exists(typval_T *argvars, typval_T *rettv) |
2992 { | 2992 { |
2993 char_u *p; | 2993 char_u *p; |
2994 char_u *name; | |
2995 int n = FALSE; | 2994 int n = FALSE; |
2996 int len = 0; | |
2997 | 2995 |
2998 p = get_tv_string(&argvars[0]); | 2996 p = get_tv_string(&argvars[0]); |
2999 if (*p == '$') /* environment variable */ | 2997 if (*p == '$') /* environment variable */ |
3000 { | 2998 { |
3001 /* first try "normal" environment variables (fast) */ | 2999 /* first try "normal" environment variables (fast) */ |
3033 n = au_exists(p + 1); | 3031 n = au_exists(p + 1); |
3034 #endif | 3032 #endif |
3035 } | 3033 } |
3036 else /* internal variable */ | 3034 else /* internal variable */ |
3037 { | 3035 { |
3038 char_u *tofree; | 3036 n = var_exists(p); |
3039 typval_T tv; | |
3040 | |
3041 /* get_name_len() takes care of expanding curly braces */ | |
3042 name = p; | |
3043 len = get_name_len(&p, &tofree, TRUE, FALSE); | |
3044 if (len > 0) | |
3045 { | |
3046 if (tofree != NULL) | |
3047 name = tofree; | |
3048 n = (get_var_tv(name, len, &tv, NULL, FALSE, TRUE) == OK); | |
3049 if (n) | |
3050 { | |
3051 /* handle d.key, l[idx], f(expr) */ | |
3052 n = (handle_subscript(&p, &tv, TRUE, FALSE) == OK); | |
3053 if (n) | |
3054 clear_tv(&tv); | |
3055 } | |
3056 } | |
3057 if (*p != NUL) | |
3058 n = FALSE; | |
3059 | |
3060 vim_free(tofree); | |
3061 } | 3037 } |
3062 | 3038 |
3063 rettv->vval.v_number = n; | 3039 rettv->vval.v_number = n; |
3064 } | 3040 } |
3065 | 3041 |