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

Improve nanorc finding heuristics. #44

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rkitover
Copy link

@rkitover rkitover commented Jul 27, 2022

Fix #43

For non-elevated users, search for the config file in this order:

  1. %ALLUSERSPROFILE%\nano\nanorc (global)
  2. %SystemRoot%\nanorc (global, for backcompat, should be removed in the future)
  3. %USERPROFILE%.nanorc
  4. %APPDATA%\nano\nanorc

For elevated users, the order is:

  1. %ALLUSERSPROFILE%\nano\elevated_nanorc
  2. %ALLUSERSPROFILE%\nanorc (for backcompat, should be removed later)

Signed-off-by: Rafael Kitover rkitover@gmail.com

lhmouse and others added 7 commits April 28, 2022 21:28
Signed-off-by: Liu Hao <lh_mouse@126.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
Signed-off-by: Liu Hao <lh_mouse@126.com>
Disable tests while building ncurses
@rkitover rkitover force-pushed the config-updates-again branch from 43908cb to bd6de61 Compare July 27, 2022 04:56
Fix lhmouse#43

For non-elevated users, search for the config file in this order:

1. %ALLUSERSPROFILE%\nano\nanorc (global)
2. %SystemRoot%\nanorc (global, for backcompat, should be removed in the
   future)
3. %USERPROFILE%\.nanorc
4. %APPDATA%\nano\nanorc

For elevated users, the order is:

1. %ALLUSERSPROFILE%\nano\elevated_nanorc
2. %ALLUSERSPROFILE%\nanorc (for backcompat, should be removed later)

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
@rkitover rkitover force-pushed the config-updates-again branch from bd6de61 to c382f04 Compare July 28, 2022 03:53
@rkitover
Copy link
Author

The logic of the function is a bit disjointed because I tried to keep the original structure, but I can rewrite it if you want.

Also when elevated the global config locations are not checked, they were previously, but I thought if your intent is to separate elevated and non-elevated configs they shouldn't be.

@lhmouse
Copy link
Owner

lhmouse commented Jul 29, 2022

I will have a look a couple of days later.

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.

discuss config file location improvements
4 participants