Code Monkey home page Code Monkey logo

Comments (15)

shyamsalimkumar avatar shyamsalimkumar commented on July 2, 2024

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.

from advancednewfile.

skuroda avatar skuroda commented on July 2, 2024

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.

from advancednewfile.

shyamsalimkumar avatar shyamsalimkumar commented on July 2, 2024

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

from advancednewfile.

skuroda avatar skuroda commented on July 2, 2024

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.

from advancednewfile.

skuroda avatar skuroda commented on July 2, 2024

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.

from advancednewfile.

shyamsalimkumar avatar shyamsalimkumar commented on July 2, 2024

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

from advancednewfile.

skuroda avatar skuroda commented on July 2, 2024

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.

from advancednewfile.

shyamsalimkumar avatar shyamsalimkumar commented on July 2, 2024

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...

from advancednewfile.

skuroda avatar skuroda commented on July 2, 2024

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

from advancednewfile.

shyamsalimkumar avatar shyamsalimkumar commented on July 2, 2024

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?

from advancednewfile.

skuroda avatar skuroda commented on July 2, 2024

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.

from advancednewfile.

shyamsalimkumar avatar shyamsalimkumar commented on July 2, 2024

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 😄

from advancednewfile.

skuroda avatar skuroda commented on July 2, 2024

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!

from advancednewfile.

shyamsalimkumar avatar shyamsalimkumar commented on July 2, 2024

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.

from advancednewfile.

stiofand avatar stiofand commented on July 2, 2024

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

from advancednewfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.