Mercurial > vim
comparison src/fold.c @ 26915:3631d2deb36c v8.2.3986
patch 8.2.3986: error messages are spread out
Commit: https://github.com/vim/vim/commit/b09feaa86ecc53b9b953710082496951776dc5c6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 2 20:20:45 2022 +0000
patch 8.2.3986: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 02 Jan 2022 21:30:04 +0100 |
parents | d4e61d61afd9 |
children | c9474ae175f4 |
comparison
equal
deleted
inserted
replaced
26914:21f9376239a4 | 26915:3631d2deb36c |
---|---|
63 static void deleteFoldMarkers(fold_T *fp, int recursive, linenr_T lnum_off); | 63 static void deleteFoldMarkers(fold_T *fp, int recursive, linenr_T lnum_off); |
64 static void foldDelMarker(linenr_T lnum, char_u *marker, int markerlen); | 64 static void foldDelMarker(linenr_T lnum, char_u *marker, int markerlen); |
65 static void foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot); | 65 static void foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot); |
66 static void parseMarker(win_T *wp); | 66 static void parseMarker(win_T *wp); |
67 | 67 |
68 static char *e_nofold = N_("E490: No fold found"); | |
69 | |
70 /* | 68 /* |
71 * While updating the folds lines between invalid_top and invalid_bot have an | 69 * While updating the folds lines between invalid_top and invalid_bot have an |
72 * undefined fold level. Only used for the window currently being updated. | 70 * undefined fold level. Only used for the window currently being updated. |
73 */ | 71 */ |
74 static linenr_T invalid_top = (linenr_T)0; | 72 static linenr_T invalid_top = (linenr_T)0; |
410 // closed fold. | 408 // closed fold. |
411 if (!opening && !recurse) | 409 if (!opening && !recurse) |
412 (void)hasFolding(lnum, NULL, &lnum_next); | 410 (void)hasFolding(lnum, NULL, &lnum_next); |
413 } | 411 } |
414 if (done == DONE_NOTHING) | 412 if (done == DONE_NOTHING) |
415 emsg(_(e_nofold)); | 413 emsg(_(e_no_fold_found)); |
416 // Force a redraw to remove the Visual highlighting. | 414 // Force a redraw to remove the Visual highlighting. |
417 if (had_visual) | 415 if (had_visual) |
418 redraw_curbuf_later(INVERTED); | 416 redraw_curbuf_later(INVERTED); |
419 } | 417 } |
420 | 418 |
783 changed_window_setting(); | 781 changed_window_setting(); |
784 } | 782 } |
785 } | 783 } |
786 if (!did_one) | 784 if (!did_one) |
787 { | 785 { |
788 emsg(_(e_nofold)); | 786 emsg(_(e_no_fold_found)); |
789 // Force a redraw to remove the Visual highlighting. | 787 // Force a redraw to remove the Visual highlighting. |
790 if (had_visual) | 788 if (had_visual) |
791 redraw_curbuf_later(INVERTED); | 789 redraw_curbuf_later(INVERTED); |
792 } | 790 } |
793 else | 791 else |
1233 (void)setManualFold(lnum, do_open, FALSE, &done); | 1231 (void)setManualFold(lnum, do_open, FALSE, &done); |
1234 if (!(done & DONE_ACTION)) | 1232 if (!(done & DONE_ACTION)) |
1235 { | 1233 { |
1236 // Only give an error message when no fold could be opened. | 1234 // Only give an error message when no fold could be opened. |
1237 if (n == 0 && !(done & DONE_FOLD)) | 1235 if (n == 0 && !(done & DONE_FOLD)) |
1238 emsg(_(e_nofold)); | 1236 emsg(_(e_no_fold_found)); |
1239 break; | 1237 break; |
1240 } | 1238 } |
1241 } | 1239 } |
1242 } | 1240 } |
1243 | 1241 |
1385 if (done & DONE_ACTION) | 1383 if (done & DONE_ACTION) |
1386 changed_window_setting_win(wp); | 1384 changed_window_setting_win(wp); |
1387 done |= DONE_FOLD; | 1385 done |= DONE_FOLD; |
1388 } | 1386 } |
1389 else if (donep == NULL && wp == curwin) | 1387 else if (donep == NULL && wp == curwin) |
1390 emsg(_(e_nofold)); | 1388 emsg(_(e_no_fold_found)); |
1391 | 1389 |
1392 if (donep != NULL) | 1390 if (donep != NULL) |
1393 *donep |= done; | 1391 *donep |= done; |
1394 | 1392 |
1395 return next; | 1393 return next; |