To: vim-dev@vim.org Subject: Patch 6.1.361 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.361 Problem: Cannot jump to a file mark with ":'M". Solution: Allow jumping to another file for a mark in an Ex address when it is the only thing in the command line. Files: src/ex_docmd.c *** ../vim61.360/src/ex_docmd.c Mon Feb 24 11:29:14 2003 --- src/ex_docmd.c Sun Feb 23 11:56:13 2003 *************** *** 123,129 **** #endif static int check_more __ARGS((int, int)); ! static linenr_T get_address __ARGS((char_u **, int skip)); static char_u *invalid_range __ARGS((exarg_T *eap)); static void correct_range __ARGS((exarg_T *eap)); static char_u *repl_cmdline __ARGS((exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep)); --- 123,129 ---- #endif static int check_more __ARGS((int, int)); ! static linenr_T get_address __ARGS((char_u **, int skip, int otherfile)); static char_u *invalid_range __ARGS((exarg_T *eap)); static void correct_range __ARGS((exarg_T *eap)); static char_u *repl_cmdline __ARGS((exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep)); *************** *** 1229,1235 **** ea.line1 = ea.line2; ea.line2 = curwin->w_cursor.lnum; /* default is current line number */ ea.cmd = skipwhite(ea.cmd); ! lnum = get_address(&ea.cmd, ea.skip); if (ea.cmd == NULL) /* error detected */ goto doend; if (lnum == MAXLNUM) --- 1229,1235 ---- ea.line1 = ea.line2; ea.line2 = curwin->w_cursor.lnum; /* default is current line number */ ea.cmd = skipwhite(ea.cmd); ! lnum = get_address(&ea.cmd, ea.skip, ea.addr_count == 0); if (ea.cmd == NULL) /* error detected */ goto doend; if (lnum == MAXLNUM) *************** *** 2936,2944 **** * Return MAXLNUM when no Ex address was found. */ static linenr_T ! get_address(ptr, skip) char_u **ptr; int skip; /* only skip the address, don't use it */ { int c; int i; --- 2936,2945 ---- * Return MAXLNUM when no Ex address was found. */ static linenr_T ! get_address(ptr, skip, otherfile) char_u **ptr; int skip; /* only skip the address, don't use it */ + int otherfile; /* flag: may jump to other file */ { int c; int i; *************** *** 2974,2987 **** ++cmd; else { ! fp = getmark(*cmd, FALSE); ++cmd; ! if (check_mark(fp) == FAIL) { ! cmd = NULL; ! goto error; } - lnum = fp->lnum; } break; --- 2975,2996 ---- ++cmd; else { ! /* Only accept a mark in another file when it is ! * used by itself: ":'M". */ ! fp = getmark(*cmd, otherfile && cmd[1] == NUL); ++cmd; ! if (fp == (pos_T *)-1) ! /* Jumped to another file. */ ! lnum = curwin->w_cursor.lnum; ! else { ! if (check_mark(fp) == FAIL) ! { ! cmd = NULL; ! goto error; ! } ! lnum = fp->lnum; } } break; *************** *** 6369,6375 **** { long n; ! n = get_address(&eap->arg, FALSE); if (eap->arg == NULL) /* error detected */ { eap->nextcmd = NULL; --- 6382,6388 ---- { long n; ! n = get_address(&eap->arg, FALSE, FALSE); if (eap->arg == NULL) /* error detected */ { eap->nextcmd = NULL; *** ../vim61.360/src/version.c Tue Feb 25 21:13:03 2003 --- src/version.c Tue Feb 25 21:37:34 2003 *************** *** 608,609 **** --- 612,615 ---- { /* Add new patch number below this line */ + /**/ + 361, /**/ -- [Autumn changed into Winter ... Winter changed into Spring ... Spring changed back into Autumn and Autumn gave Winter and Spring a miss and went straight on into Summer ... Until one day ...] "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///