comparison src/message.c @ 9538:26da1efa9e46 v7.4.2049

commit https://github.com/vim/vim/commit/f6acffbe83e622542d9fdf3066f51933e46e4954 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 16 16:54:24 2016 +0200 patch 7.4.2049 Problem: There is no way to get a list of the error lists. Solution: Add ":chistory" and ":lhistory".
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Jul 2016 17:00:06 +0200
parents d18d71ae21e5
children 00ee8d8c2e0c
comparison
equal deleted inserted replaced
9537:eb80b386b249 9538:26da1efa9e46
311 { 311 {
312 for (i = (int)STRLEN(s); len + (n = ptr2cells(s + i - 1)) <= room; --i) 312 for (i = (int)STRLEN(s); len + (n = ptr2cells(s + i - 1)) <= room; --i)
313 len += n; 313 len += n;
314 } 314 }
315 315
316 /* Set the middle and copy the last part. */ 316
317 if (e + 3 < buflen) 317 if (i <= e + 3)
318 { 318 {
319 /* text fits without truncating */
320 if (s != buf)
321 {
322 len = STRLEN(s);
323 if (len >= buflen)
324 len = buflen - 1;
325 len = len - e + 1;
326 if (len < 1)
327 buf[e - 1] = NUL;
328 else
329 mch_memmove(buf + e, s + e, len);
330 }
331 }
332 else if (e + 3 < buflen)
333 {
334 /* set the middle and copy the last part */
319 mch_memmove(buf + e, "...", (size_t)3); 335 mch_memmove(buf + e, "...", (size_t)3);
320 len = (int)STRLEN(s + i) + 1; 336 len = (int)STRLEN(s + i) + 1;
321 if (len >= buflen - e - 3) 337 if (len >= buflen - e - 3)
322 len = buflen - e - 3 - 1; 338 len = buflen - e - 3 - 1;
323 mch_memmove(buf + e + 3, s + i, len); 339 mch_memmove(buf + e + 3, s + i, len);
324 buf[e + 3 + len - 1] = NUL; 340 buf[e + 3 + len - 1] = NUL;
325 } 341 }
326 else 342 else
327 { 343 {
328 buf[e - 1] = NUL; /* make sure it is truncated */ 344 /* can't fit in the "...", just truncate it */
345 buf[e - 1] = NUL;
329 } 346 }
330 } 347 }
331 348
332 /* 349 /*
333 * Automatic prototype generation does not understand this function. 350 * Automatic prototype generation does not understand this function.