notepad-plus-plus / notepad-plus-plus

Notepad++ official repository
https://notepad-plus-plus.org/
Other
22.97k stars 4.6k forks source link

The link for Open User Defined language Folder... does not work #8394

Open dbkaynor opened 4 years ago

dbkaynor commented 4 years ago

The link for language/User Defined language/Open User Defined language Folder… does not work I click on it and nothing happens.

======Version information ============ Notepad++ v7.8.6 (32-bit) Build time : Apr 21 2020 - 15:17:06 Path : C:\Program Files (x86)\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 1909 OS Build : 18363.720 Plugins : BracketsCheck.dll ComparePlugin.dll CustomLineNumbers.dll docMonitor.unicode.dll DSpellCheck.dll Explorer.dll HexEditor.dll JSMinNPP.dll mimeTools.dll MultiClipboard.dll NotepadStarterPlugin.dll NppConverter.dll NppExport.dll NppFavorites.dll NPPJSONViewer.dll NppPluginDemo.dll NppPluginTemplate.dll NppSaveAsAdmin.dll NppTextFX.dll NppXmlTreeviewPlugin.dll SpellChecker.dll TakeNotes.dll XMLTools.dll _CustomizeToolbar.dll

====== Reply from PeterJones ============ PeterJones 9 minutes ago @Douglas-Kaynor-0 said in The link for Open User Defined language Folder... does not work:

My path to the “User Defined language Folder…” is C:\Users\dkaynor\AppData\Roaming\Notepad++\userDefineLangs There is a file in the above folder. The cloud radio button was enabled and set to C:\Users\dkaynor\OneDrive. Once I set it to No Cloud the link works. I checked my OneDrive folder and there are several Notepad++ files in it.

Thanks.

When I set a v7.8.6-32bit to not use local config, enabling cloud to a dummy “cloud” folder (not really a cloud folder), it populates that folder with the main config files, but not a userDefineLangs folder. If I create \path\to\cloud\userDefineLangs folder and put in the default markdown UDL in that folder and re-run, it does not include the markdown UDL in Notepad++ and the Open User Defined Language Folder… does nothing (doesn’t open the folder).

qwythebroken commented 4 years ago

I have a different UDL problem. However, while I'm still working through it, I may have found a solution for this one.

Long story short, I ended up thoroughly wiping and reinstalling (which didn't help) and, bumped in to this while restoring preferences. I've never used it before but, for some reason, I enabled the cloud. A little later, I noticed UDL folder link wasn't working.

Checking the designated cloud folder, I saw NotePad had started populating my config stuffs but the UDL folder hadn't shown up yet. Like you, I generated a UserDefineLangs folder manually and reopened NPP. When that didn't work, I put my problem child UDL file in there, instead of, "Markdown (Default)". When I went back to NotePad++, the link worked, my UDL is in the languages and UDL dropdowns.

A few minutes later, I see your post. Seeing how my install is less than an hour old, I figured I might as well continue breaking things since fixing them hasn't been going my way. So, I just disabled the cloud. As expected, it all broke. Initially, enabling the cloud was one of the first things I had set so, not much had populated in, AppData\Roaming. Following the same steps;

  1. Generated a New Folder named, "UserDefineLangs" in %AppData%
  2. Added a valid UDL.xml. This time, a copy of, "userDefineLang.xml"

    I edited the name tag, on line 2,

      from;     
             ` <UserLang name="Markdown (Default)" ext="md markdown" udlVersion="2.1">`
      To:
             `<UserLang name="wtf" ext="wtf" udlVersion="2.1">`

When I restarted NPP, wtf was in the UDL and language dropdowns and the link worked.

I haven't seen my new install generate a copy of userDefineLang.xml, on its own yet. Or a UDL folder. Seems wrong however, in all fairness, I haven't really given the interface much of an indication I wanted either. It might be fine. I also, haven't tested other configs although, I'd suppose it's a similar deal. If there's any confusion on which path the link is currently pointing to, generate the folder in all of them and drop a tell-tale file inside?

------Just in cases: Current Environment Notepad++ v7.9 (64-bit) Build time : Sep 22 2020 - 03:19:04 Path : C:\Program Files\Notepad++\notepad++.exe Admin mode : OFF Local Conf mode : OFF OS Name : Windows 10 Home (64-bit) OS Version : 2004 OS Build : 19041.572 Current ANSI codepage : 1252 Plugins : BigFiles.dll DSpellCheck.dll Explorer.dll ExtSettings.dll mimeTools.dll NppConverter.dll NppExport.dll NppFavorites.dll NppSaveAsAdmin.dll NppSnippets.dll

lmstearn commented 4 years ago

Have a problem here with this as well. To date, the User Defined Language files have resided in \Program Files (x86)\Notepad++, but of late, N++ does not pick them up from there at all. One can select a UDL file in the menu, but there is no change of language styles in the editor. Following this guide for AHK, are those instructions for UDL installation up-to-date?

qwythebroken commented 3 years ago

I think I can still help get this sorted. Parts of your description has me wondering if the problem isn't more complex.

Either way,

Regardless of where a UDL, like AHK, will be saved, there's a couple of methods to install it. The instructions in your link would probably still work but in recent versions those steps are overlapping multiple methods that work independently. Here's a few options to choose from.

1. If the folder opened, you could drop the language.xml file in to, and restart Npp. 2. If you know where the folder needs to be, manually generate it, drop in the .xml, and restart Npp. 3. Forget the folder. Open the UDL Panel. Click import, navigate to the .xml file, and hit open.

In all cases, the name and location of the .xml install file isn't relevant. Npp displays the value for the Name attribute specified in the, "UserLang" element in the xml. "save as" rewrites that attribute.

Once the installation is complete, Npp dumps the original file from the UDL folder and generates a file named, "userDefineLang.xml" in the root of the active default directory. Once you figure out which folder your settings have been saving to, take a good look at this file in that folder. It's my best guess for whatever is causing this;

One can select a UDL file in the menu, but there is no change of language styles in the editor.

Determining which folder is active.

Usual Suspects

1. Cloud: - C:\RootMyCloud\Notepad++\

64B & 32B Step1:check preferences menu. Could be anywhere

2. Roaming: - C:\User\NameUser\%AppData%\Notepad++\ | 64B & 32B | PrimeSuspect

3. 64Bit: - C:\%ProgramFiles%\Notepad++\

4. 32Bit: - C:\%ProgramFiles(x86)%\Notepad++\

5. Local: - C:\User\NameUser\%LocalAppData%\Notepad++\ 64B & 32B | Unlikely

6. Local: - \RootNpp\UserDefineLang.xml
Download and Install Everything. Start searching for, "++"

Running searches, opening up source files and pouring over the settings will eventually answer the question but, here's a simple alternative for anyone unsure where to begin. Providing, local mode hasn't been enabled.

It only takes a second to double check the cloud option, in the preference menu. If it's enabled, the answer is right next to it. A solid first step. If the Cloud hasn't been enabled, chances are, it's one of the usual suspects, above. Probably #2.

Whichever one, it's safe bet it doesn't have a, "userDefineLang" subfolder. If it did, the link in the Language dropdown would have opened it. So, give them one. Generate a "userDefineLang" folder and put a copy in, at least, 2-5. Go back to the language dropdown and check the link. Odds are pretty good it's working.

lmstearn commented 3 years ago

Thanks. think the problem is more of a specific nature regarding my setup. Have two rigs (not new) where one has my username, and the other has a generic (factory install) username which at the time seemed convenient to retain.

Both machines backup to C:\RootMyCloud\, (not the recommended C:\RootMyCloud\Notepad++). I think this was when the N++ cloud feature was introduced. Not a very good idea, as there are N++ files and directories all over RootMyCloud. Not so much of a problem with that as when N++ does some routine file/directory pass on machine 2 and finds all the pathnames referring to machine 1's C:\User\NameUser%LocalAppData%\Notepad++\ in the xml files incorrect, as there is a different username.

N++ never tells you there is a problem with that, it just resets the config to default. Perhaps the cheapest remedy is for N++ just to check NameUser in pathnames within cloud xml files and issue a warning before proceeding?

qwythebroken commented 3 years ago

Hrm... I think I understand. Have you tried setting up both machines to pull from one cloud, bypassing ? I save my settings to a dropbox folder in anticipation of accessing them from two separate instances. I don't share my computer so dropbox is at C:\Dropbox but, I'd guess any networked folder they can read and write to, should do.

Hopefully, I'm not going way off track however, assuming the problem is still path related, I suspect the following would be a safe method to transition both to a cloud. After creating backups and copies and all that, obviously. Quick Disclaimer, I can't say I've actually done this.

Putting aside the UDL problem, I'm assuming one install is further from your ideal setup, I'd start with that one. All I would do is set the cloud to a folder they both can access, in preferences. Nothing special required for the name. It might be safest to start with a separate sub-folder for each, in that folder although, personally, I'd probably go with the final destination. I doubt you need to hear this from me however, just in case, take special care to note what your settings were, before making changes, just so you can go back.

Close the instance to generate the settings files, and use the machine, closer to ideal, to go through them. This needs to be the only open instance, between the two machines. You're looking for any settings you want to keep and making those changes to the open interface. This is good point to see if you need to manually generate any sub-folders, like "userDefineLangs". It's also a good point to open up your UDL's .xml and verify it's not corrupted. Occasionally, I'll find Unicode for Chinese characters are replacing font names and colors. It's not often but it happens, For some reason, only in delimiters...

Once your satisfied with the settings, the last step would be set the cloud, in preferences, to the new folder and close the instance. Keep in mind, this is going to write over the files generated by the the first machine. There's probably going to be a few more things to tweak but, that should do it.

Depending on your needs, this might be a little time consuming but, possibly worth it. Of course, if the two instances need to be separate, go with subfolders for each however, a shared folder might still be a good place for them. if you decide it's easier to edit the files than to poke through the menus, be sure to save them as copies or your work will be written over by the current settings once you close the instance.

If that doesn't work, I'd probably wipe both and start fresh. Setting up the cloud would be the first thing I'd do on both.

Good Luck!

Edditoria commented 3 years ago

Hi all,

I am one of the creator of Markdown syntax UDL of NPP. Here's my 2 cents to solve this problem at client (user) side.

Problem

I inspected that this problem occurs because NPP does not create the directories automatically when users add/change the cloud directory.

Solution

For example, it should be something look like this when I setup the Cloud directory at <%UserProfile%\Documents\Notepad++\>:

npp-issue-8394

npp-issue-8394-2

You will need to manage your config files after you change the Cloud directory.

sebma commented 5 months ago

Hi, in a normal (not cloud) N++ installation, what is the path to the "User Defined Language folder" ?

Is it %appdata%\Notepad++\functionList or %appdata%\Notepad++\userDefineLangs ?