comparison src/sign.c @ 15388:7444fffa482d v8.1.0702

patch 8.1.0702: ":sign place" only uses the current buffer commit https://github.com/vim/vim/commit/b589f95b38ddd779d7e696abb0ea011dc92ea903 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 7 22:10:00 2019 +0100 patch 8.1.0702: ":sign place" only uses the current buffer Problem: ":sign place" only uses the current buffer. Solution: List signs for all buffers when there is no buffer argument. Fix error message for invalid buffer name in sign_place(). (Yegappan Lakshmanan, closes #3774)
author Bram Moolenaar <Bram@vim.org>
date Mon, 07 Jan 2019 22:15:04 +0100
parents 317846db300a
children c17b5e30a0af
comparison
equal deleted inserted replaced
15387:6793601c7f2e 15388:7444fffa482d
1235 linenr_T *lnum) 1235 linenr_T *lnum)
1236 { 1236 {
1237 char_u *arg1; 1237 char_u *arg1;
1238 char_u *name; 1238 char_u *name;
1239 char_u *filename = NULL; 1239 char_u *filename = NULL;
1240 int lnum_arg = FALSE;
1240 1241
1241 // first arg could be placed sign id 1242 // first arg could be placed sign id
1242 arg1 = arg; 1243 arg1 = arg;
1243 if (VIM_ISDIGIT(*arg)) 1244 if (VIM_ISDIGIT(*arg))
1244 { 1245 {
1257 if (STRNCMP(arg, "line=", 5) == 0) 1258 if (STRNCMP(arg, "line=", 5) == 0)
1258 { 1259 {
1259 arg += 5; 1260 arg += 5;
1260 *lnum = atoi((char *)arg); 1261 *lnum = atoi((char *)arg);
1261 arg = skiptowhite(arg); 1262 arg = skiptowhite(arg);
1263 lnum_arg = TRUE;
1262 } 1264 }
1263 else if (STRNCMP(arg, "*", 1) == 0 && cmd == SIGNCMD_UNPLACE) 1265 else if (STRNCMP(arg, "*", 1) == 0 && cmd == SIGNCMD_UNPLACE)
1264 { 1266 {
1265 if (*signid != -1) 1267 if (*signid != -1)
1266 { 1268 {
1325 return FAIL; 1327 return FAIL;
1326 } 1328 }
1327 1329
1328 // If the filename is not supplied for the sign place or the sign jump 1330 // If the filename is not supplied for the sign place or the sign jump
1329 // command, then use the current buffer. 1331 // command, then use the current buffer.
1330 if (filename == NULL && (cmd == SIGNCMD_PLACE || cmd == SIGNCMD_JUMP)) 1332 if (filename == NULL && ((cmd == SIGNCMD_PLACE && lnum_arg)
1333 || cmd == SIGNCMD_JUMP))
1331 *buf = curwin->w_buffer; 1334 *buf = curwin->w_buffer;
1332 1335
1333 return OK; 1336 return OK;
1334 } 1337 }
1335 1338