feature(customize) : Add the default path for the custom template#71
feature(customize) : Add the default path for the custom template#71Kashin-J wants to merge 1 commit intoshiyanhui:masterfrom
Conversation
- According to the document specification of Sublime Text(see: http://docs.sublimetext.info/en/sublime-text-3/basic_concepts.html#the-user-package), custom data for the user's plug-in should be stored in the `Packages/User` folder. - `Packages/User` folder data can be used for synchronization between multiple machines.(see: https://packagecontrol.io/docs/syncing) - So I created the `FileHeader-template/header` and `FileHeader-template/body` folders in the `Packages/User` directory, which are used as the default directory for the template files.
|
Hi, I'm wondering that have you tested it? Actually it doesn't work since |
|
I'm sure I've tested it, and it works fine.You may need to carefully review the code. |
| BODY_PATH = os.path.join(PLUGIN_PATH, 'template/body') | ||
| INSTALLED_PLGIN_PATH = os.path.abspath(os.path.dirname(__file__)) | ||
| DEFAULT_CUSTOM_TEMPLATE_HEADER_PATH = os.path.join(PACKAGES_PATH, 'User/FileHeader-template/header') | ||
| DEFAULT_CUSTOM_TEMPLATE_BODY_PATH = os.path.join(PACKAGES_PATH, 'User/FileHeader-template/body') |
There was a problem hiding this comment.
Change it to below may be better:
DEFAULT_CUSTOM_TEMPLATE_PATH = os.path.join(PACKAGES_PATH, 'User/FileHeader-template') DEFAULT_CUSTOM_TEMPLATE_HEADER_PATH = os.path.join(DEFAULT_CUSTOM_TEMPLATE_PATH, 'header') DEFAULT_CUSTOM_TEMPLATE_BODY_PATH = os.path.join(DEFAULT_CUSTOM_TEMPLATE_PATH, 'body')
|
Yeah, you are right, sorry. I write some review to make the code more clean. After you modified it, I'll merge it. Thanks:) |
|
Thank you for your revision. |
Packages/Userfolder.Packages/Userfolder data can be used for synchronization between multiple machines.(see: https://packagecontrol.io/docs/syncing)FileHeader-template/headerandFileHeader-template/bodyfolders in thePackages/Userdirectory, which are used as the default directory for the template files.