Author Topic: fill-paragraph equivalent in SE  (Read 1763 times)

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
fill-paragraph equivalent in SE
« on: July 14, 2017, 12:44:45 PM »
Emacs has command called fill-paragraph. It basically restructures current paragraph to fit into certain width. It is a bit smarter than simple line wrap because it understands various languages, e.g. Javadoc. So when calling fill-paragraph on something like:
Code: [Select]
/********************
 * Long text here
 *******************/
It will correctly restructure it as:
Code: [Select]
/********************
 * Long
 * text
 * here
 *******************/
I am wondering if SE has something similar. Comment wrap seems to be close to what I am looking for, but comment wrap changes text as I type. What I need is something that does it once, on demand.

Thanks

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: fill-paragraph equivalent in SE
« Reply #1 on: July 14, 2017, 02:50:29 PM »
I found "reflow-comment" command. At least judging by the name, it does something like I want, but for reasons I don't understand it doesn't do anything. Any ideas?

Dennis

  • Senior Community Member
  • Posts: 3965
  • Hero Points: 517
Re: fill-paragraph equivalent in SE
« Reply #2 on: July 18, 2017, 02:35:34 PM »
Have you checked the comment wrap settings?  Document > C/C++ Options... > Comment Wrap.

reflow_comment uses those settings.  gui_reflow_comment will prompt you and let you reflow a comment with other specific settings.