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

Default Directory does not work #11326

Closed
K2AAE opened this issue Mar 2, 2022 · 13 comments
Closed

Default Directory does not work #11326

K2AAE opened this issue Mar 2, 2022 · 13 comments

Comments

@K2AAE
Copy link

K2AAE commented Mar 2, 2022

Set the Default Directory to 'last used directory' then exit, when you open NP++ again then click File/Open it looks in C:\Program Files\Notepad++

I expect it to look in the last directory I was working in NOT the install directory.

@dfs-
Copy link

dfs- commented Mar 2, 2022

From what you describe I don’t see a directory you were working in, so the default (= installation folder) is used.

Are there some additional steps you perform. I would suspect after changing the settings you need to open at least one file.

@Yaron10
Copy link

Yaron10 commented Mar 2, 2022

Last used directory is only remembered for the current session.
Exiting and restating NPP, the installation folder is displayed in the Open/Save dialog.

I think @K2AAE is correct and that folder should be saved to config.xml.

@alankilborn
Copy link
Contributor

I experimented with this on 8.2.1 and I see the behavior described above.
Then I changed it back to Follow current document (the only sensical choice IMO).

However, on fresh restart of N++, I wanted to make a new PythonScript and when I went to Plugins > PythonScript > New Script and it wanted to create my new file in yesterday's "last directory". :-(

I guess not a N++ problem per se, I just found it unusual enough to say something about it.

@Yaron10
Copy link

Yaron10 commented Mar 3, 2022

@alankilborn,

I experimented with this on 8.2.1 and I see the behavior described above.

I suppose you mean "Last used directory is only remembered for the current session.".

However, on fresh restart of N++, I wanted to make a new PythonScript and when I went to Plugins > PythonScript > New Script and it wanted to create my new file in yesterday's "last directory". :-(

I can't reproduce that.
NPP 8.3.2.
PythonScript 2.0.

@alankilborn
Copy link
Contributor

I suppose you mean "Last used directory is only remembered for the current session.".

Well... in my case something remembered it from yesterday. :-)
And it was totally frustrating to have to navigate all the way to my scripts folder in order to create a new script. :-)

NPP 8.3.2.

I am not brave enough to go there yet. To 8.3.* I mean.

PythonScript 2.0.

So far I can't go there either, as my 1.5.4 sophisticated setup isn't quite working under 2.0. :-(

@Yaron10
Copy link

Yaron10 commented Mar 3, 2022

Well... in my case something remembered it from yesterday. :-)

It's certainly not in config.xml.
Interesting.

And it was totally frustrating to have to navigate all the way to my scripts folder in order to create a new script.

But in NPP Open/Save it was NOT remembered after restart, correct?

I am not brave enough to go there yet. To 8.3.* I mean.

If you don't take the plunge, who would? :)

@Yaron10
Copy link

Yaron10 commented Mar 3, 2022

@alankilborn,

Completely off-topic.

TCHAR text2Find[MAX_PATH];

Can you think of a reason it's MAX_PATH instead of FINDREPLACE_MAXLENGTH?

@alankilborn
Copy link
Contributor

But in NPP Open/Save it was NOT remembered after restart, correct?

Right. My situation is off-topic and not worth pursuing; I just wanted to mention it.

Can you think of a reason it's MAX_PATH instead of FINDREPLACE_MAXLENGTH?

Nope. Seems like you could create some STR a bug and open an issue.

@Yaron10
Copy link

Yaron10 commented Mar 3, 2022

@alankilborn,

Thank you. 👍

@K2AAE
Copy link
Author

K2AAE commented Mar 5, 2022

I gave up on Last and Follow, set directory to a folder in Home, shut NPP down and on restart File Save opened in that Home directory instead of the install location. Note: %HOMEPATH% would be the place to open at if nothing is set, the install directory should be write proof by normal users.

@Yaron10
Copy link

Yaron10 commented Jul 11, 2023

@molsonkiko,

I've never used "Last Used Directory" in real-life.
But there are quite a few opened issues about it.

#4961.
#10901.
#4119.

What do you think?

@molsonkiko
Copy link
Contributor

I have what appears to be a very clean fix to this issue - total diff is only five lines of code. Still testing it, but so far looks good.

I may be able to submit a PR later today.

@Yaron10
Copy link

Yaron10 commented Jul 11, 2023

@molsonkiko,

👍
That would be great!

I really believe that a developer like yourself would be an asset to any project. :)
Thank you for your work.

If I can't try your PR tonight, I'll do it tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants