[vim/vim] fnamemodify with ':~' mod adds a trailing slash when it should not (#3524)

20 views
Skip to first unread message

Asheq Imran

unread,
Oct 9, 2018, 5:38:43 PM10/9/18
to vim/vim, Subscribed

To reproduce:

let $HOME='my/home'

  • echo fnamemodify('my', ':~')
    • prints my
  • echo fnamemodify('my/home/dir', ':~')
    • prints ~/dir
  • echo fnamemodify('my/home', ':~')
    • prints ~/
    • expected ~

In the last case, why does it print a trailing slash (~/)?

I only expect the trailing slash if the path passed into fnamemodify itself has trailing slash e.g. my/, my/home/dir/, my/home/.


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

Erick Paquin

unread,
Jan 2, 2023, 5:08:46 PM1/2/23
to vim/vim, Subscribed

@Asheq ,

Is this still an issue? This was posted 5 years ago approximately. If you still have the issue, what version of vim are you running and on which OS?

Also, have you checked the help for fnamemodify() and filename-modifiers? Some interesting clues in there.

Thanks.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/3524/1369239835@github.com>

Christian Brabandt

unread,
Jan 9, 2023, 7:31:03 AM1/9/23
to vim/vim, Subscribed

Closed #3524 as completed.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/3524/issue_event/8181310514@github.com>

Christian Brabandt

unread,
Jan 9, 2023, 7:31:03 AM1/9/23
to vim/vim, Subscribed

can no longer reproduce on Vim 9.0.078 but on an old 8.1.3741.

So closing, assuming it has been fixed.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/3524/1375558461@github.com>

Reply all
Reply to author
Forward
0 new messages