patch 9.0.0145: substitute that joins lines drops text properties

Problem:    Substitute that joins lines drops text properties.
Solution:   Move text properties of the last line to the new line.
diff --git a/src/textprop.c b/src/textprop.c
index 86b0dbf..9e643f7 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -12,7 +12,6 @@
  *
  * TODO:
  * - Adjust text property column and length when text is inserted/deleted.
- *   -> a :substitute with a multi-line match
  *   -> search for changed_bytes() from misc1.c
  *   -> search for mark_col_adjust()
  * - Perhaps we only need TP_FLAG_CONT_NEXT and can drop TP_FLAG_CONT_PREV?
@@ -683,6 +682,29 @@
     curbuf->b_ml.ml_flags |= ML_LINE_DIRTY;
 }
 
+/*
+ * Add "text_props" with "text_prop_count" text propertis to line "lnum".
+ */
+    void
+add_text_props(linenr_T lnum, textprop_T *text_props, int text_prop_count)
+{
+    char_u  *text;
+    char_u  *newtext;
+    int	    proplen = text_prop_count * (int)sizeof(textprop_T);
+
+    text = ml_get(lnum);
+    newtext = alloc(curbuf->b_ml.ml_line_len + proplen);
+    if (newtext == NULL)
+	return;
+    mch_memmove(newtext, text, curbuf->b_ml.ml_line_len);
+    mch_memmove(newtext + curbuf->b_ml.ml_line_len, text_props, proplen);
+    if (curbuf->b_ml.ml_flags & (ML_LINE_DIRTY | ML_ALLOCATED))
+	vim_free(curbuf->b_ml.ml_line_ptr);
+    curbuf->b_ml.ml_line_ptr = newtext;
+    curbuf->b_ml.ml_line_len += proplen;
+    curbuf->b_ml.ml_flags |= ML_LINE_DIRTY;
+}
+
     static proptype_T *
 find_type_by_id(hashtab_T *ht, int id)
 {