Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Reflow selection breaks indentation #31

Closed
izuzak opened this issue Jul 1, 2015 · 6 comments
Closed

Reflow selection breaks indentation #31

izuzak opened this issue Jul 1, 2015 · 6 comments

Comments

@izuzak
Copy link

izuzak commented Jul 1, 2015

From @danbim on July 1, 2015 10:1

If I have a block of text indented and I use the "reflow selection" command (cmd+alt+q on Mac) the resulting text block will only keep the intended indentation in the first line but lose it in the following lines. While for some file types this might be the correct behaviour, IMO for many others it's not. Therefore "reflow selection" is unusable for my source code.

screen shot 2015-07-01 at 11 57 20

If the current behaviour is still to be supported I suggest to make this a customizable behaviour, e.g., depending on file type.

Copied from original issue: atom/atom#7621

@ssfrr
Copy link

ssfrr commented Jul 2, 2015

It would be awesome if reflowing were a little more code-aware. I'm a heavy user of the gq feature in vim for automatically reformatting my code, and it's a real time-saver.

@wmayner

This comment has been minimized.

@mglukhovsky
Copy link

I'm sorely missing the behavior of gq in Vim, where you can reflow text while respecting indentations -- would love to see this in autoflow.

@voidexp
Copy link

voidexp commented May 10, 2016

Really annoying behavior, makes the reflow pretty useless for long docstrings and text. :(

@cwwalter
Copy link

cwwalter commented Oct 7, 2016

I'm not positive if this is really still an issue for the people who originally reported it, but I was trying to find packages to fix this problem this evening and after a bit determined (by accident) that the default autoflow package actually works as we wish if you are careful how you make the selection.

The key is how you start it. If you do this:

screen shot 2016-10-07 at 8 11 58 pm

You will get what you see in @izuzak's post. However, if you start like this:

screen shot 2016-10-07 at 8 13 00 pm

(note that the 1st line starts the selection all the way on the left) then it will wrap properly at 80 characters with the indentation for the entire block preserved. It's not obvious if the package is designed this way on purpose but, as long as you make sure the first line also includes the indentation of the final result you want it seems to work.

@daviwil
Copy link
Contributor

daviwil commented Sep 11, 2018

This issue was moved to atom/atom#18026

@daviwil daviwil closed this as completed Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants