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 the tab completion of paths containing \t\n #10357

Closed
wants to merge 2 commits into from

Conversation

dhoegh
Copy link
Contributor

@dhoegh dhoegh commented Feb 27, 2015

This is my fix to the issue with path completion for paths containing \t\n discussed in #10336.

c,r = test_complete(s)
@test r == endof(s)-4:endof(s)
@test "space\\ .file\"" in c
for whitspace in @windows? [" "] : [" ","\t","\n"]
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @windows? macro is on the copping block (eg @StefanKarpinski hates it because of the un intuitive parsing). Not sure how to write this as pretty without it though.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's been on the chopping block for a while now. @StefanKarpinski when were you going to rewrite this as @os windows ? a : b?

@dhoegh
Copy link
Contributor Author

dhoegh commented Feb 27, 2015

I will look at the Travis failures tommorrow.

@test r == endof(s)-4:endof(s)
@test "space\\$(whitspace).file" in c

s = @windows? "cd(\"β $dir_space\\\\space" : "cd(\"β $dir_space/space"
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than splitting this on OS here, I think you could just interpolate Base.path_separator into the string

@dhoegh
Copy link
Contributor Author

dhoegh commented Feb 28, 2015

The current state of the pull are able to complete paths with \t\r, but it introduces a lot of problems in the REPL. Even the terminal in Ubuntu cannot complete the paths in a reasonable manner and therefore I think it is not worth the hassle for path completion for a very small user case.

With this in mind I think the correction discussed in #10336, which I reverted in 2b81792 should be matches = UTF8String[replace(s, r" ", "\\ ") for s in matches] and not matches = UTF8String[replace(s, r"\s", "\\ ") for s in matches] due to the current logic only handles the case with spaces in paths and not \t\n.

Should I reintroduce the correction in #10336 or a new pull and then close this in current state, for future reference if someone really would like to introduce this small feature which nobody seems to handle elegantly. cc @JeffBezanson, @vtjnash.

@dhoegh dhoegh mentioned this pull request Mar 2, 2015
@dhoegh
Copy link
Contributor Author

dhoegh commented Mar 8, 2015

I'm going to close this due to the above.

@dhoegh dhoegh closed this Mar 8, 2015
@tkelman
Copy link
Contributor

tkelman commented Mar 10, 2015

I do think reverting 2b81792 would be a more accurate and correct representation of what we're supporting. Hopefully it's a rare corner case that not many people will hit though.

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.

4 participants