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

Ctrl-N (New File) opens file selector dialog, instead of simply creating the file #5141

Open
2 of 5 tasks
chiphogg opened this issue May 6, 2024 · 8 comments
Open
2 of 5 tasks
Labels
bug A bug that affects the functionality of Zettlr.

Comments

@chiphogg
Copy link

chiphogg commented May 6, 2024

Description

If this was an intentional change, it'd be great to at least get the option to change it back.

I'm accustomed to being able to quickly create a file via Ctrl-N, and immediately start adding contents. The file name is not a concern, since I name 100% of my files according to the YYYYMMDDHHMMSS schema. However, now when I do this, I get a "save file" dialog, which forces me to use the mouse.

Worse, the default location appears to be my Documents folder, which is not the folder I'm using for Zettlr. The result is that I had been creating files in the wrong folder for a while before I realized it!

Reproducing

  1. Type Ctrl-N to make a new markdown file.

Observe that this produces a dialog, whose default folder is ~/Documents.

What it should do instead is to simply create a file with the correct ID, and store it in the active folder that Zettlr is using. This was the behaviour in 2.3.x, which I was using before.

The desired behaviour is also what happens when I make a link to a nonexistent file, such as [[20240506170920]], and then follow the link. (Note that I have the "Automatically create non-existing files in this folder when following internal links" option enabled.)

Curiously, there does appear to be a setting for this! Under "Advanced", the first option is "Pattern for new file names", which has a checkbox "Do not prompt for filename when creating new files". This doesn't seem to have any effect that I can see. This makes it feel like this is just a bug and not an intentional change.

Zettlr Version

Stable (most recent version)

Specify version

3.1.1

Installation Method

From the Website or GitHub

Your Platform

  • Windows
  • macOS
  • Linux

Architecture

  • Intel 64bit
  • ARM 64bit

Operating System Version

Ubuntu 22.04

Additional Information

No response

@chiphogg chiphogg added the bug A bug that affects the functionality of Zettlr. label May 6, 2024
@BabakFarshchian
Copy link

I experience the same behavior. I think the problem is that the option "Do not prompt for filename when creating new files" under Advanced does not have any effect. It opens the new file window whether checked or not.

This behavior initiated with version 3.1.

@Arminius
Copy link

Even if you do want to choose your own filenames, the fact that the file dialog opens on the folder ~/Documents makes Ctrl+N completely useless as a shortcut. Why would anyone ever want to create files under ~/Documents rather than the current workspace, especially as a default? Now it's faster to right-click on the workspace and select "New File" rather than use the keyboard shortcut.

It's honestly reason enough to roll back to an earlier version.

@ailintom
Copy link

This is closely related to #5123 , but the crucial point raised here is that "Do not prompt for filename when creating new files" is ignored and new files are not created for dead link

@BabakFarshchian
Copy link

This is closely related to #5123 , but the crucial point raised here is that "Do not prompt for filename when creating new files" is ignored and new files are not created for dead link

Could this be an options screen problem? I know that the screen was introduced recently. The reason for this is I have another example of an option that does not have an effect. See #5178

@ice7512
Copy link

ice7512 commented Jun 1, 2024

I have made an AHK (WINDOWS ONLY) script to deal with this problem as a temporary fix:

  1. Download and install ahk
  2. Paste this into a .txt file
  3. Change 'folderaddress' next to send to the folder you want to save to. For example C:\Users\MyDog\DogNotes\2024
  4. Change the .txt file to a .ahk
  5. Double click the .ahk file you've made to run the script
  6. After you open the save dialogue hit Ctrl + J
  7. It will save it to the correct folder for you

Copy paste theis

;Hit ctrl + N in Zettlr and then run this script
^j:: ; This sets the hotkey to Control+J. Activates the script.
Send, !d ; Presses 'Alt+D' once. Selects the address bar.
Send, folderaddress ; Types in 'folderaddress'. Types into the address bar.
Send, !s ; Presses 'Alt+S' once. Saves the document

Example Script:

;Hit ctrl + N in Zettlr and then run this script
^j:: ; This sets the hotkey to Control+J. Activates the script.
Send, !d ; Presses 'Alt+D' once. Selects the address bar.
Send, C:\Users\MyDog\DogNotes\2024; Types in 'C:\Users\MyDog\DogNotes\2024'. Types into the address bar.
Send, !s ; Presses 'Alt+S' once. Saves the document

@nathanlesage
Copy link
Member

This was an intended change because I wanted to reduce the complexity a bit, but I've already received tons of negative feedback on this. I am aware of this, and will revert this change in an update.

@BabakFarshchian
Copy link

My workaround is to right-click on the file browser and choose "New file" from the pop-up menu. It works like a charm ;-)

@nathanlesage
Copy link
Member

My workaround is to right-click on the file browser and choose "New file" from the pop-up menu. It works like a charm ;-)

That's what I almost ALWAYS do nowadays, and I think that is partly to blame for me making the change in the first place. It's hard to keep track of all the various ways in which users use the app (and which is why I'm absolutely happy to have @sensologica by now, to stop me from doing that in the future … I HOPE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug that affects the functionality of Zettlr.
Projects
None yet
Development

No branches or pull requests

6 participants