Skip to content

:A fails when previously-opened alternate not co-located and filename is suffix of another alternate #8

@brombres

Description

@brombres

Using a.vim from commit f3cfbbf:

Steps to Reproduce

  • Create the following directory structure (files can be empty or contain placeholder content):

      bugtest/AlphaBeta.h
      bugtest/Beta.cpp
      bugtest/include/Beta.h
    
  • Edit all files:

      mvim bugtest/AlphaBeta.h bugtest/Beta.cpp bugtest/include/Beta.h
    
  • :n to advance to Beta.cpp.

  • :A should open Beta.h but instead opens a new file (buffer) Beta.h in the same directory as Beta.cpp.

  • If AlphaBeta.h were removed, or renamed to AlphaGamma.h, then :A works fine on Beta.cppBeta.h.

  • It seems that :A on Beta.cpp cannot decide between include/Beta.h and AlphaBeta.h and so it chooses neither.

    • In such a case, a filename match (regardless of directory path) should be selected over a string prefix match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions