ahuth / brackets-paste-and-indent

Paste code at the correct indentation level
29 stars 7 forks source link

Paste without reformat on Ctrl+Shift+V #5

Open tomek-he-him opened 10 years ago

tomek-he-him commented 10 years ago

From time to time I have code in my files which is indented differently than the automatic indentation would suggest. For example jQuery scripts often have the following syntax:

$(element)
    .addClass(newClass)
    .css(newStyles)
    .doAwesomeStuff();

I would love to have an option to copy/cut and paste these snippets within my project without having them reindented.

[Ctrl+Shift+V] seems to be a well-known convention for pasting "pure stuff" used by LibreOffice and other programs.

ahuth commented 10 years ago

That sounds reasonable. The only issue is that the extension doesn't tie in directly to Brackets' keyboard shortcuts. Instead, it uses events fired off by Codemirror.

Let me look into firing off a custom Codemirror event (called a 'change'), or if I can tie into Bracket's keyboard shortcuts to do this.

ghost commented 10 years ago

I'm also very interested on this issue. At now i'm disabling the plugin because copy jade code is a bit messy (destroy all the indentation and place every line at first line)

ahuth commented 10 years ago

I understand. There's definitely times when things don't get indented as they should, and everything gets messed up. Sorry about that!

To be honest, though, I don't use Brackets anymore, so this extension will probably not be worked on anymore by me. Thanks for your interest in it, though!

ghost commented 10 years ago

Anyway, thanks for your work