yomybaby / atom-titanium

[DEPRECATED] Atom package for Titanium Alloy
https://atom.io/packages/titanium-alloy
MIT License
49 stars 11 forks source link

Customizing template for hyperclick code generating #44

Closed yomybaby closed 8 years ago

yomybaby commented 8 years ago

Recent @DouglasHennrich suggested this customizing feature. (#42 Thanks Douglas)

There are issue related with : https://discuss.atom.io/t/the-way-to-insert-next-line-n-into-config-string-type/29639

If anyone have an idea for this issue, please write comment on this issue.

yomybaby commented 8 years ago

Before adding text to editor, \\n should be replaced with \n. After this, default template should be changed from \n to \\n.

DouglasHennrich commented 8 years ago

we should write anything on the template input and then go to ~/.atom/config.cson and edit there the template.

captura de tela 2016-06-06 as 13 48 44

yomybaby commented 8 years ago

https://discuss.atom.io/t/the-way-to-insert-next-line-n-into-config-string-type/29639/2?u=yomybaby

The \n is just a convention that means "whatever is the line ending character(s) for the current platform". ... The Settings View is doing the right thing, when you type \n turning it into "\n" in the config.cson, that's the proper way to encode that value so that it comes back as \n when you view it in the Settings View again.

According to the above, I think that using \n on setting view is better. If you want to set in the config.cson, you should use \\n instead of pressing enter.

DouglasHennrich commented 8 years ago

I already tried to use on template input on setting view and its outputs \\n

yomybaby commented 8 years ago

What I want to say is \\n is a expected result in config.json from \n setting view. So I just want to keep this way.

Check this 2a9e03b commit.

After this commit :

On setting view, use \n On config.json, use \\n It works properly.

settings_ __users_yomybaby_documents_tiworkspace_sandbox520ga

index_tss_ __users_yomybaby_documents_tiworkspace_sandbox520ga index_tss_ __users_yomybaby_documents_tiworkspace_sandbox520ga
yomybaby commented 8 years ago

@DouglasHennrich After update to v0.11.2, you have to change your custom generationTemplate.