From c930a3cc82074f14f2674aa039ca46d961edb297 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Fri, 20 May 2005 21:27:20 +0000
Subject: [PATCH] updated for version 7.0074

---
 runtime/filetype.vim |  5 ++++-
 src/edit.c           | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 4d561f2580..0639b5633d 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2005 May 18
+" Last Change:	2005 May 20
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -528,6 +528,9 @@ au BufNewFile,BufRead *esmtprc			setf esmtprc
 " ESQL-C
 au BufNewFile,BufRead *.ec,*.EC			setf esqlc
 
+" Esterel
+au BufNewFile,BufRead *.strl			setf esterel
+
 " Essbase script
 au BufNewFile,BufRead *.csc			setf csc
 
diff --git a/src/edit.c b/src/edit.c
index 42b459d382..bce0d83afc 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -6708,6 +6708,22 @@ ins_bs(c, mode, inserted_space_p)
 	    {
 		temp = gchar_cursor();	/* remember current char */
 		--curwin->w_cursor.lnum;
+
+		/* When "aw" is in 'formatoptions' we must delete the space at
+		 * the end of the line, otherwise the line will be broken
+		 * again when auto-formatting. */
+		if (has_format_option(FO_AUTO)
+					   && has_format_option(FO_WHITE_PAR))
+		{
+		    char_u  *ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum,
+									TRUE);
+		    int	    len;
+
+		    len = STRLEN(ptr);
+		    if (len > 0 && ptr[len - 1] == ' ')
+			ptr[len - 1] = NUL;
+		}
+
 		(void)do_join(FALSE);
 		if (temp == NUL && gchar_cursor() != NUL)
 		    inc_cursor();
-- 
GitLab