patch 8.0.1013: terminal window behaves different from a buffer with changes

Problem:    A terminal window with a running job behaves different from a
            window containing a changed buffer.
Solution:   Do not set 'bufhidden' to "hide".  Fix that a buffer where a
            terminal used to run is listed as "[Scratch]".
diff --git a/src/buffer.c b/src/buffer.c
index f64255d..e95abfa 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5825,8 +5825,8 @@
 	if (buf->b_term != NULL)
 	    return term_get_status_text(buf->b_term);
 #endif
-	if (buf->b_sfname != NULL)
-	    return buf->b_sfname;
+	if (buf->b_fname != NULL)
+	    return buf->b_fname;
 	return (char_u *)_("[Scratch]");
     }
 
diff --git a/src/terminal.c b/src/terminal.c
index 288ad28..b2a3e7f 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -44,10 +44,7 @@
  * - add test for giving error for invalid 'termsize' value.
  * - support minimal size when 'termsize' is "rows*cols".
  * - support minimal size when 'termsize' is empty?
- * - do not set bufhidden to "hide"?  works like a buffer with changes.
- *   document that CTRL-W :hide can be used.
  * - GUI: when using tabs, focus in terminal, click on tab does not work.
- * - When $HOME was set by Vim (MS-Windows), do not pass it to the job.
  * - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
  *   changes to "!shell".
  *   (justrajdeep, 2017 Aug 22)
@@ -399,10 +396,6 @@
      * the job finished. */
     curbuf->b_p_ma = FALSE;
 
-    /* Set 'bufhidden' to "hide": allow closing the window. */
-    set_string_option_direct((char_u *)"bufhidden", -1,
-				      (char_u *)"hide", OPT_FREE|OPT_LOCAL, 0);
-
     set_term_and_win_size(term);
     setup_job_options(opt, term->tl_rows, term->tl_cols);
 
diff --git a/src/version.c b/src/version.c
index 3be91c2..26604fd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1013,
+/**/
     1012,
 /**/
     1011,