Skip to content

:A can't see alternate files #187

Description

@j-xella

It happens when I save nvim session and then reload it. I use NVIM v0.10.0-dev-2016+g5dc0bdfe9, the latest version of projectionist (commit a57b9bf) and have the following config:

"*.cc" : {
   "alternate" : [
      "{dirname|dirname}/include/{basename}.h",
      "{}.h"
   ]
},

After I restart nvim, load my session and am in file /path/to/src/Name.cc (pathes redacted), executing :A command, I get this prompt:

Create alternate file?
1 /path/to/include/Name.h
2 /path/to/src/Name.h
Type number and <Enter> or click with the mouse (q or empty cancels):

This is already a problem, because the file 1 actually exists. If I manually enter the command :e /path/to/include/Name.h, I can open and edit the header file without any problems. But if I select the option 1 from the above prompt, I am landed in a new (!!!) buffer that is empty but has the same file name as existing file. Reloading the new buffer (:e! or :e %) does not work - I am still in that empty buffer... Using :ls, I see that I have 2 buffers now with the same file path:

460 #a   /path/to/include/Name.h:1
12  %a=  /path/to/include/Name.h:274

The buffer with lower id is the real file that has been opened before. The buffer with higher id is the one created by projectionist instead of opening the real file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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