@@ -3634,27 +3634,41 @@ maketitle(void)
36343634#define SPACE_FOR_ARGNR (IOSIZE - 10) /* at least room for " - VIM" */
36353635 if (curbuf -> b_fname == NULL )
36363636 vim_strncpy (buf , (char_u * )_ ("[No Name]" ), SPACE_FOR_FNAME );
3637+ #ifdef FEAT_TERMINAL
3638+ else if (curbuf -> b_term != NULL)
3639+ {
3640+ vim_strncpy (buf , term_get_status_text (curbuf -> b_term ),
3641+ SPACE_FOR_FNAME );
3642+ }
3643+ #endif
36373644 else
36383645 {
36393646 p = transstr (gettail (curbuf -> b_fname ));
36403647 vim_strncpy (buf , p , SPACE_FOR_FNAME );
36413648 vim_free (p );
36423649 }
36433650
3644- switch (bufIsChanged (curbuf )
3645- + (curbuf -> b_p_ro * 2 )
3646- + (!curbuf -> b_p_ma * 4 ))
3647- {
3648- case 1 : STRCAT (buf , " +" ); break ;
3649- case 2 : STRCAT (buf , " =" ); break ;
3650- case 3 : STRCAT (buf , " =+" ); break ;
3651- case 4 :
3652- case 6 : STRCAT (buf , " -" ); break ;
3653- case 5 :
3654- case 7 : STRCAT (buf , " -+" ); break ;
3655- }
3651+ #ifdef FEAT_TERMINAL
3652+ if (curbuf -> b_term == NULL )
3653+ #endif
3654+ switch (bufIsChanged (curbuf )
3655+ + (curbuf -> b_p_ro * 2 )
3656+ + (!curbuf -> b_p_ma * 4 ))
3657+ {
3658+ case 1 : STRCAT (buf , " +" ); break ;
3659+ case 2 : STRCAT (buf , " =" ); break ;
3660+ case 3 : STRCAT (buf , " =+" ); break ;
3661+ case 4 :
3662+ case 6 : STRCAT (buf , " -" ); break ;
3663+ case 5 :
3664+ case 7 : STRCAT (buf , " -+" ); break ;
3665+ }
36563666
3657- if (curbuf -> b_fname != NULL )
3667+ if (curbuf -> b_fname != NULL
3668+ #ifdef FEAT_TERMINAL
3669+ && curbuf -> b_term == NULL
3670+ #endif
3671+ )
36583672 {
36593673 /* Get path of file, replace home dir with ~ */
36603674 off = (int )STRLEN (buf );
@@ -3671,18 +3685,8 @@ maketitle(void)
36713685 p = gettail_sep (buf + off );
36723686 if (p == buf + off )
36733687 {
3674- char * txt ;
3675-
3676- #ifdef FEAT_TERMINAL
3677- if (curbuf -> b_term != NULL )
3678- txt = term_job_running (curbuf )
3679- ? _ ("running" ) : _ ("finished" );
3680- else
3681- #endif
3682- txt = _ ("help" );
3683-
3684- /* must be a help or terminal buffer */
3685- vim_strncpy (buf + off , (char_u * )txt ,
3688+ /* must be a help buffer */
3689+ vim_strncpy (buf + off , (char_u * )_ ("help" ),
36863690 (size_t )(SPACE_FOR_DIR - off - 1 ));
36873691 }
36883692 else
@@ -5680,16 +5684,20 @@ buf_spname(buf_T *buf)
56805684 return (char_u * )_ (msg_qflist );
56815685 }
56825686#endif
5683- #ifdef FEAT_QUICKFIX
5687+
56845688 /* There is no _file_ when 'buftype' is "nofile", b_sfname
5685- * contains the name as specified by the user */
5689+ * contains the name as specified by the user. */
56865690 if (bt_nofile (buf ))
56875691 {
5692+ #ifdef FEAT_TERMINAL
5693+ if (buf -> b_term != NULL )
5694+ return term_get_status_text (buf -> b_term );
5695+ #endif
56885696 if (buf -> b_sfname != NULL )
56895697 return buf -> b_sfname ;
56905698 return (char_u * )_ ("[Scratch]" );
56915699 }
5692- #endif
5700+
56935701 if (buf -> b_fname == NULL )
56945702 return (char_u * )_ ("[No Name]" );
56955703 return NULL ;
0 commit comments