diff src/fold.c @ 15470:55ccc2d353bd v8.1.0743

patch 8.1.0743: giving error messages is not flexible commit https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 13 23:38:42 2019 +0100 patch 8.1.0743: giving error messages is not flexible Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes #3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Jan 2019 23:45:08 +0100
parents 03831e5ea0de
children 1ec942f1b648
line wrap: on
line diff
--- a/src/fold.c
+++ b/src/fold.c
@@ -410,7 +410,7 @@ opFoldRange(
 	    (void)hasFolding(lnum, NULL, &lnum_next);
     }
     if (done == DONE_NOTHING)
-	EMSG(_(e_nofold));
+	emsg(_(e_nofold));
     /* Force a redraw to remove the Visual highlighting. */
     if (had_visual)
 	redraw_curbuf_later(INVERTED);
@@ -561,9 +561,9 @@ foldManualAllowed(int create)
     if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin))
 	return TRUE;
     if (create)
-	EMSG(_("E350: Cannot create fold with current 'foldmethod'"));
+	emsg(_("E350: Cannot create fold with current 'foldmethod'"));
     else
-	EMSG(_("E351: Cannot delete fold with current 'foldmethod'"));
+	emsg(_("E351: Cannot delete fold with current 'foldmethod'"));
     return FALSE;
 }
 
@@ -775,7 +775,7 @@ deleteFold(
     }
     if (!did_one)
     {
-	EMSG(_(e_nofold));
+	emsg(_(e_nofold));
 	/* Force a redraw to remove the Visual highlighting. */
 	if (had_visual)
 	    redraw_curbuf_later(INVERTED);
@@ -1211,7 +1211,7 @@ setFoldRepeat(linenr_T lnum, long count,
 	{
 	    /* Only give an error message when no fold could be opened. */
 	    if (n == 0 && !(done & DONE_FOLD))
-		EMSG(_(e_nofold));
+		emsg(_(e_nofold));
 	    break;
 	}
     }
@@ -1363,7 +1363,7 @@ setManualFoldWin(
 	done |= DONE_FOLD;
     }
     else if (donep == NULL && wp == curwin)
-	EMSG(_(e_nofold));
+	emsg(_(e_nofold));
 
     if (donep != NULL)
 	*donep |= done;
@@ -1735,7 +1735,7 @@ foldCreateMarkers(linenr_T start, linenr
 {
     if (!curbuf->b_p_ma)
     {
-	EMSG(_(e_modifiable));
+	emsg(_(e_modifiable));
 	return;
     }
     parseMarker(curwin);