jrowny / brackets-snippets

A brackets snippets extension
http://www.github.com/adobe/brackets
Other
129 stars 42 forks source link

Keyboard shortcuts + Rewrite #38

Open zaggino opened 10 years ago

zaggino commented 10 years ago

Besides obvious - provide definable keyboard shortcuts for particular snippets, this is also a complete rewrite of the extension files. Code has been split into more files and snippet insertion algorithms have been rewritten.

In old codes line is split into parts and removed from document, then a completely new line(s) is inserted to the place of the old one.

In new codes, line is no longer removed - instead the arguments are collected and only the parts that are actually used for the snippets are later replaced on the same line. As a result of this, you no longer see weird steps when doing Undo (Ctrl+Z) after inserting a snippet.

I hope I haven't introduced any new bugs and we can talk about the new code logic if you'll have time to go through it.

This was originally made from about 30 commits so I squashed it into two because nobody would ever go through them step by step.

jrowny commented 10 years ago

This is a lot to review, I'll try to get through it this week.

zaggino commented 10 years ago

I know, I wanted to just implement the shortcut thingy first, but then hit a problem there, hit a problem there and after implementing it the code looked too ugly. So that's the main reason for rewrite. Take as much time as you need.

zaggino commented 10 years ago

Ping @jrowny :-)

maxwowpow commented 10 years ago

Ctrl Shift S is bound to save as in Brackets.

zaggino commented 10 years ago

This is merged in my fork at https://github.com/zaggino/brackets-snippets