implement default titlestring using statusline #1248
Labels
complexity:low
Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md
core
Nvim core functionality or code
defaults
issues or PRs involving changing the defaults
enhancement
feature request
statusline
tabline, winbar, statuscolumn
Milestone
At the moment, when
titlestring
is not set, the default value is generated by accessingcurbuf->b_fname
,bufIsChanged(curbuf)
,curbuf->b_ffname
&append_arg_number()
(an extracted version of this is insrc/nvim/title.c:113
).Unfortunately, it is not possible to reproduce this behaviour using a statusline format string. The closest might be:
where those represent the flags found in
option_defs.h
:The only part which differs from the default
titlestring
is%F
, which shows the full path of the file, including the last part (tail). The default uses the full path of the file with the part in%t
and the final seperator removed.The best way to allow for this would be to add a new statusline flag, say
%d
which shows the full path of the directory containing the current file.Then, since statusline support is on all the time (according to
src/nvim/version.c:140
), we can simplify the implementation ofmaketitle()
to always use the standard statusline processing.Thoughts? Objections?
The text was updated successfully, but these errors were encountered: