Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fill-paragraph behaves unexpectedly in Twig comments #42

Closed
NateEag opened this issue Mar 16, 2013 · 5 comments
Closed

fill-paragraph behaves unexpectedly in Twig comments #42

NateEag opened this issue Mar 16, 2013 · 5 comments

Comments

@NateEag
Copy link
Contributor

NateEag commented Mar 16, 2013

Consider the following code snippet:

{#
    This is a test comment. Imagine I was writing some lengthy explanation
    of an odd subtlety in this template's behavior, and at some point, I
    reached a point where I wanted to refill the paragraph, so I pressed
    M-q. web-mode will mangle the following code badly.
#}
{% for diff in commit.diffs %}
<div class="source-view">
    <div class="source-header">
        <div class="meta"><a name="{{ loop.index }}">{{ diff.file }}</div>
    </div>

As it says, if I use M-q to fill the paragrah, I would expect only the comment's contents to be filled, but instead, everything up to the first blank line is filled, making M-q useless for comments.

Tested with current master, using Aquamacs 2.4 (a.k.a Emacs 23.3.50.1).

@fxbois
Copy link
Owner

fxbois commented Mar 16, 2013

@NateEag could you provide 2 gist files : the source before and the source after (after = the way you would like that it would indented) ... I've never used fill-paragraph
tia

@fxbois
Copy link
Owner

fxbois commented Mar 16, 2013

@NateEag Ok got it
I should only indent the comment at fill-column width.
Is that what you want ?
Could you confirm that tou would never M-q in an other place than a comment ?

@NateEag
Copy link
Contributor Author

NateEag commented Mar 17, 2013

Yes - I would like the comment to be wrapped to fill-column width, and only the comment to be wrapped, not any of the following lines. That is the behavior I am used to from other programming modes.

I'm not aware of a use for fill-paragraph other than free-flowing text, so I can't see offhand where you'd use it other than a comment.

The gists you requested:

https://gist.github.com/NateEag/5179360 - before
https://gist.github.com/NateEag/5179366 - after

@fxbois
Copy link
Owner

fxbois commented Mar 17, 2013

should be better with last commit. I'll have to implement all the cases (I have to be compatible with all the comment syntaxes)

@NateEag
Copy link
Contributor Author

NateEag commented Mar 19, 2013

Much better. Thanks!

@fxbois fxbois closed this as completed Mar 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants