diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-06-24 15:53:16 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-06-24 15:53:16 +0000 |
commit | f4b8e57ffd048f9ca46dd7618939ba7a1b2294ec (patch) | |
tree | 08865b59e356d861c0d1321e4adaef8385e53635 /src/ex_cmds2.c | |
parent | 69a7cb473ceae109b61fae9aa04ee0c29afba5d9 (diff) | |
download | vim-f4b8e57ffd048f9ca46dd7618939ba7a1b2294ec.zip |
updated for version 7.0002
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 3aa463338..67134820d 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -375,6 +375,7 @@ dbg_parsearg(arg) char_u *p = arg; char_u *q; struct debuggy *bp; + int here = FALSE; if (ga_grow(&dbg_breakp, 1) == FAIL) return FAIL; @@ -385,6 +386,16 @@ dbg_parsearg(arg) bp->dbg_type = DBG_FUNC; else if (STRNCMP(p, "file", 4) == 0) bp->dbg_type = DBG_FILE; + else if (STRNCMP(p, "here", 4) == 0) + { + if (curbuf->b_ffname == NULL) + { + EMSG(_(e_noname)); + return FAIL; + } + bp->dbg_type = DBG_FILE; + here = TRUE; + } else { EMSG2(_(e_invarg2), p); @@ -393,7 +404,9 @@ dbg_parsearg(arg) p = skipwhite(p + 4); /* Find optional line number. */ - if (VIM_ISDIGIT(*p)) + if (here) + bp->dbg_lnum = curwin->w_cursor.lnum; + else if (VIM_ISDIGIT(*p)) { bp->dbg_lnum = getdigits(&p); p = skipwhite(p); @@ -402,7 +415,8 @@ dbg_parsearg(arg) bp->dbg_lnum = 0; /* Find the function or file name. Don't accept a function name with (). */ - if (*p == NUL + if ((!here && *p == NUL) + || (here && *p != NUL) || (bp->dbg_type == DBG_FUNC && strstr((char *)p, "()") != NULL)) { EMSG2(_(e_invarg2), arg); @@ -411,6 +425,8 @@ dbg_parsearg(arg) if (bp->dbg_type == DBG_FUNC) bp->dbg_name = vim_strsave(p); + else if (here) + bp->dbg_name = vim_strsave(curbuf->b_ffname); else { /* Expand the file name in the same way as do_source(). This means |