Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file completion #152

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Mar 1, 2018

Please see the commits for details.

@mhinz
Copy link
Owner

mhinz commented Mar 1, 2018

What does the first commit fix in the "foo " case? I can't see any difference.

Currently the completion doesn't seem to handle files with whitespaces. But checking against path should be correct in that case as it tries to complete a second file.

And I'm no fan of the vint changes. Replacing " by two ' for no good reason just makes the code more unreadable. Just leave away style changes. :>

It would be cool if you would use one commit per change. It's kind of hard to follow otherwise. And :Gblame is more useful afterwards, since you can quickly see why the code was changed.

@blueyed blueyed force-pushed the fix-complete_files branch from 4c8a524 to 9591a26 Compare March 13, 2018 23:28
@blueyed
Copy link
Contributor Author

blueyed commented Mar 14, 2018

Changed the vint changes.. for the map expr you can use "'foo'", i.e. double quotes for the outer level.
What about a .vintrc.yaml?

policies:
  ProhibitEqualTildeOperator:
    enabled: false
  ProhibitUnnecessaryDoubleQuote:
    enabled: false

(although I would prefer to fix them)

Will have to revisit this PR / answer your comments, but might take a while.

@blueyed blueyed force-pushed the fix-complete_files branch from 48d60d8 to 3f36bbf Compare April 18, 2018 16:26
It seems like this just confused path with head for completing relative
files.  With "foo " head contains whitespace at the end, but path does
not.

This fixes completion of relative files basically.
- handle '~/' correctly: previously is was even matched by the
  `=~ '^.\/'`, which turned "~/foo" into "./foo" then!
- handle relative paths without prefix at the end
- fix issues reported by vint (single quotes)
mmrwoods added a commit to mmrwoods/vim-grepper that referenced this pull request Apr 20, 2022
- Expand tilde alone to $HOME (same as vim's built in path completion)
- Support completion of paths relative to ~/ (taken from PR mhinz#152)

This is getting quite messy now, but that's ok, we have some tests!
Refactoring can come later, maybe when supporting hidden files/dirs.
mmrwoods added a commit to mmrwoods/vim-grepper that referenced this pull request Apr 20, 2022
- Expand tilde alone to $HOME (same as vim's built in path completion)
- Support completion of paths relative to ~/ (taken from PR mhinz#152)

This is getting quite messy now, but that's ok, we have some tests!
Refactoring can come later, maybe when supporting hidden files/dirs.
mmrwoods added a commit to mmrwoods/vim-grepper that referenced this pull request May 6, 2022
- Expand tilde alone to $HOME (same as vim's built in path completion)
- Support completion of paths relative to ~/ (taken from PR mhinz#152)

This is getting quite messy now, but that's ok, we have some tests!
Refactoring can come later, maybe when supporting hidden files/dirs.
mmrwoods added a commit to mmrwoods/vim-grepper that referenced this pull request May 6, 2022
- Expand tilde alone to $HOME (same as vim's built in path completion)
- Support completion of paths relative to ~/ (taken from PR mhinz#152)

This is getting quite messy now, but that's ok, we have some tests!
Refactoring can come later, maybe when supporting hidden files/dirs.
mmrwoods added a commit to mmrwoods/vim-grepper that referenced this pull request May 6, 2022
- Expand tilde alone to $HOME (same as vim's built in path completion)
- Support completion of paths relative to ~/ (taken from PR mhinz#152)

This is getting quite messy now, but that's ok, we have some tests!
Refactoring can come later, maybe when supporting hidden files/dirs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants