atom-wrap-in-tag icon indicating copy to clipboard operation
atom-wrap-in-tag copied to clipboard

Work with block elements

Open pdxwolfy opened this issue 9 years ago • 7 comments

I'd like to see this work cleanly with multi-line elements. That is, it should change this:

    <p>
      blah blah blah
    </p>

to:

   <div>
     <p>
       blah blah blah
     </p>
   </div>

when the 3 lines are selected and you type

. Right now, it just kind of makes a mess of things:
      <div>    <p>
      blah blah blah
    </p>
 </div>

where the final

is flush left in the file.

pdxwolfy avatar Dec 28 '15 02:12 pdxwolfy

Should we format the code block automatically? I am not sure, some users may disagree that this should happen automatically maybe a check box in the settings?

On Mon, Dec 28, 2015, 4:40 AM pdxwolfy [email protected] wrote:

I'd like to see this work cleanly with multi-line elements That is, it should change this:

<p>
  blah blah blah
</p>

to:

blah blah blah

when the 3 lines are selected and you type Right now, it just kind of makes a mess of things:

  <div>    <p>
  blah blah blah
</p>

where the final is flush left in the file

— Reply to this email directly or view it on GitHub https://github.com/sanusart/atom-wrap-in-tag/issues/3.

sanusart avatar Dec 28 '15 05:12 sanusart

Thanks for the response. You probably know your users better than I do, but I wouldn't object to a configurable check box. As for formatting, that would probably depend on how hard it would be. I'd be happy if wrapping complete lines of text simply just put the tags above and below the selected block, preferably at the original indentation. Whether it indents the wrapped text any further is less important (auto indent may already do that if it is on).

pdxwolfy avatar Dec 28 '15 05:12 pdxwolfy

No built-in auto indent in atom as far as I know, to keep core as small as possible or to let users choose their tools I guess.

On Mon, Dec 28, 2015, 7:19 AM pdxwolfy [email protected] wrote:

Thanks for the response. You probably know your users better than I do, but I wouldn't object to a configurable check box. As for formatting, that would probably depend on how hard it would be. I'd be happy if wrapping complete lines of text simply just put the tags above and below the selected block, preferably at the original indentation. Whether it indents the wrapped text any further is less important (auto indent may already do that if it is on).

— Reply to this email directly or view it on GitHub https://github.com/sanusart/atom-wrap-in-tag/issues/3#issuecomment-167486612 .

sanusart avatar Dec 28 '15 05:12 sanusart

Auto Indent on Paste is one of the core settings.

pdxwolfy avatar Dec 28 '15 05:12 pdxwolfy

Oh, cool. I'll check it out.

On Mon, Dec 28, 2015, 7:39 AM pdxwolfy [email protected] wrote:

Auto Indent on Paste is one of the core settings.

— Reply to this email directly or view it on GitHub https://github.com/sanusart/atom-wrap-in-tag/issues/3#issuecomment-167489699 .

sanusart avatar Dec 28 '15 07:12 sanusart

I would like to voice my agreement for a feature like this, I love this plugin by the way, not sure why its not a native function of atom!

cworf avatar Oct 20 '17 16:10 cworf

It seems like you could just indent the selected block of lines and put the wrapper tag and closing tag at the least most indentation previously used by the block?

I think that's how this other atom package does it. The other package has the flaw that it doesn't stop editing both tags on space and I constantly have to backup and hit escape twice before adding attributes.

littlebee avatar May 30 '18 18:05 littlebee