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

Going up the folder tree #48

Closed
shyamsalimkumar opened this issue Aug 23, 2013 · 15 comments
Closed

Going up the folder tree #48

shyamsalimkumar opened this issue Aug 23, 2013 · 15 comments

Comments

@shyamsalimkumar
Copy link

As mentioned here, : can be used to make a file in the same folder. But it is currently not possible to go up the tree. Or at least I'm unaware as to how this can be achieved.

And it would be nice to use something like the default . to indicate the current folder and .. to indicate the parent folder rather than :.

@shyamsalimkumar
Copy link
Author

Also right now, I tried :/./ and hit Tab and got to a drive root C:/Documents and Settings and so on. Please note that the project that was open was actually in drive E:/. Maybe its something to do with the Windows file system, I'm not really sure. I haven't checked the same for Linux. Will update this thread once I do.

@skuroda
Copy link
Contributor

skuroda commented Aug 23, 2013

No need for the /. Entering : will start it from the current directory. Enter something like :my_new_file will create my_new_file in the current working directory.

@shyamsalimkumar
Copy link
Author

I did that :file.txt and it worked exactly like you said 😄 but I tried out :/./ just out of curiosity... Saw something weird... so I just thought of letting you know

@skuroda
Copy link
Contributor

skuroda commented Aug 23, 2013

Great, I can look into that. Just wanted to make sure you knew how the : worked since that was the original problem. If I had to guess, it's because I do some odd handling of a linux style absolute paths on windows systems.

@skuroda
Copy link
Contributor

skuroda commented Sep 3, 2013

Relative paths will now be based on current working directory. It is a setting, but it's enabled by default. I tried :/./ and everything looked okay to me. Let me know if you still have issues.

@shyamsalimkumar
Copy link
Author

I cloned the repo... but I did not get any change in behavior... did not work on Linux... :/./file.ext pointed to /file.ext at least on the status bar... and no file was created... when I hit enter

@skuroda
Copy link
Contributor

skuroda commented Sep 3, 2013

When I said relative paths, I meant when you enter something like ./foo/bar into the input field. As for :/./file I was referring to the Windows issue where you had a file in E:\ but it was showing C:\. It falling to the root directory is expected, though should be fixed such that a / should only bring you to the home directory if it's the first token. My guess is it didn't create the file because of a permissions issue.

@shyamsalimkumar
Copy link
Author

My bad... I misunderstood
:/./ Windows issue fixed... It now points to the correct drive 👍
Both ./ and ../ work. I can go up the folder tree... 😃

My guess is it didn't create the file because of a permissions issue.

Yup... permission issue...

@skuroda
Copy link
Contributor

skuroda commented Sep 4, 2013

I pushed a fix that should take care of paths like :/./something

@shyamsalimkumar
Copy link
Author

That works too... Also I noticed something... Unsure whether its usual behavior or not, but just thought you should know
:./folder1/folder2/../file.ext creates folder1 (in the current directory) containing bother folder2 and file.ext. and opens file.ext

Also if someone stupidly (I am very curious) tried to do something like /folder:folder2 the error message they get in the console would be

error: Cannot create '/folder:folder2'. See console for details
[AdvancedNewFile] ERROR Exception: Access is denied '/'

But if they tried /folder:folder2/file.ext the error message in the console would be

error: Cannot create '/folder:folder2/file.ext'. See console for details
[AdvancedNewFile] ERROR Exception: The directory name is invalid '/folder:folder2'

Shouldn't the first error message be something like The filename is invalid '/folder:folder2'

Again these are not really issues. But in the off chance that someone is stupid enough to try it, they should be provided with the proper response. Don't you feel so?

@skuroda
Copy link
Contributor

skuroda commented Sep 5, 2013

I'll try to address the first issue soon. The second issue I knew about. Technically, the permission error is correct. A colon is a valid path character. Though if they are used, I'm pretty sure this plugin would have issues. That being said, the errors should be consistent.

@shyamsalimkumar
Copy link
Author

As long as you are aware of the above mentioned its fine... No one is going to try something stupid like what I did... At least no one with any sense... The colon is a valid name for a file? Its valid for paths like file:// right? Not for file names... I didn't know they were valid for paths... thanks for that info 😄

@skuroda
Copy link
Contributor

skuroda commented Sep 5, 2013

Yup, do a touch or mkdir in your terminal. 😄 I didn't know either until I thought "I wonder if this will mess things up". Anyways, going to close this and open a few more issues just to keep things straight for myself. If you feel like being creative and testing any other odd cases, please do! Thanks for using the plugin and the feedback!

@shyamsalimkumar
Copy link
Author

Indeed a touch/mkdir does allow colon in the name of a file/folder. Who knew...
It was my pleasure 😄 testing your plugin. I shall continue to file issues when I come across them.

@stiofand
Copy link

':' at the beginning does not work as expected on Mac

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

No branches or pull requests

3 participants