idbrii / unity-vimeditor

Add vim to the Unity's External Tools section in Preferences so all your files open in gvim.
MIT License
18 stars 8 forks source link

Allow editing multiple projects #5

Open arnaudcoj opened 2 years ago

arnaudcoj commented 2 years ago

If we open gvim for more than one project they will use the same server (Unity by default) resulting in unexpected behaviour We can change it manually of course, but I thought it was a good idea to add the project GUID in the generated server name to ensure each instance is unique by default.

One drawback is that the window name is long and not really "aesthetic" (it shows something like Test.cs (D:\GameDev\[...]) - UNITY (909CF5643-V9RJV03C4[...])) so I could understand if this PR is not merged

I also surrounded {GetServerName()} with double-quote to allow a server name with spaces

idbrii commented 2 years ago

GUIDs are usually not displayed to users, so dumping that in the vim title bar doesn't seem like a good default. Would using Application.productName accomplish the same result?

Possibly Application.identifier would be more unique, but I'm not sure it's usually defined on all platforms.