[vim/vim] bufname() doesn't follow the description (#8629)

12 views
Skip to first unread message

Jaehwang Jerry Jung

unread,
Jul 24, 2021, 3:19:38 PM7/24/21
to vim/vim, Subscribed

Problem: bufname() does not return the name displayed by the ":ls" command, in contrary to the documentation.

Some tests are failing because of this change. While they can be fixed easily, it seems likely that some plugins might be relying on this "wrong" behavior. What do you think?


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/8629

Commit Summary

  • bufname() doesn't follow the description

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Jaehwang Jerry Jung

unread,
Jul 24, 2021, 3:26:28 PM7/24/21
to vim/vim, Subscribed

Oh this breaks netrw.

Bram Moolenaar

unread,
Jul 24, 2021, 3:34:14 PM7/24/21
to vim...@googlegroups.com, Jaehwang Jerry Jung

Jaehwang Jerry Jung wrote:

> Problem: bufname() does not return the name displayed by the
> ":ls" command, in contrary to the documentation.
>
> Some tests are failing because of this change. While they can be fixed
> easily, it seems likely that some plugins might be relying on this
> "wrong" behavior. What do you think?

Changing what bufname() returns most likely will break something.

What is the difference with you expectation that matters?
Perhaps updating the documentation works better.


--
hundred-and-one symptoms of being an internet addict:
230. You spend your Friday nights typing away at your keyboard

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Christian Brabandt

unread,
Jul 24, 2021, 3:56:39 PM7/24/21
to vim/vim, Subscribed

perhaps the documentation should be updated then?

Jaehwang Jerry Jung

unread,
Jul 25, 2021, 3:03:30 AM7/25/21
to vim/vim, Push

@tomtomjhj pushed 2 commits.

  • 3a5bf91 Revert "bufname() doesn't follow the description"
  • 0f0fa83 remove reference to ":ls" in bufname,bufnr doc


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

Jaehwang Jerry Jung

unread,
Jul 25, 2021, 3:04:16 AM7/25/21
to vim/vim, Subscribed

Reverted the change and updated the documentation

Christian Brabandt

unread,
Jul 25, 2021, 5:15:40 AM7/25/21
to vim/vim, Subscribed

I am curious, in what cases does it differ from the output of the :ls command? Should we mention, that bufname() does not always match the output from the :ls command? Or perhaps it is possible to change the :ls command instead?

Jaehwang Jerry Jung

unread,
Jul 25, 2021, 8:14:37 AM7/25/21
to vim/vim, Subscribed

bufname() doesn't return the "special values" like [No Name].

Bram Moolenaar

unread,
Jul 25, 2021, 8:54:35 AM7/25/21
to vim/vim, Subscribed

I think it's useful to mention the :ls command, but make clear that the name is not exactly the same.
No need to updated the PR.

Bram Moolenaar

unread,
Jul 25, 2021, 8:54:35 AM7/25/21
to vim/vim, Subscribed

Closed #8629.

Reply all
Reply to author
Forward
0 new messages