# SlickEdit Community

## SlickEdit Product Discussion => SlickEdit® => Topic started by: timur on June 20, 2019, 09:43:04 pm

Title: Does reflow comment work with Unix shell scripts?
Post by: timur on June 20, 2019, 09:43:04 pm
Is Document->Reflow Comment supposed to work on Unix shell scripts?  I have tried all sorts of options and variations, and this feature never does anything for me.

One feature that I need often is to reflow a comment block so that the right margin is at the 80-character mark.  I sometimes indent comment blocks as I copy/paste them to another part of my script and then indent the block.  So for example:

Code: [Select]
if [[ -z $TEST ]]then # This is a very long comment line that reaches all the way to column 80 # and then some.fi becomes: Code: [Select] if [[ -z$TEST ]]then    command    if [ $? -ne 0 ] then # This is a very long comment line that reaches all the way to column 80 # and then some. fifi And I want Slickedit to change that to: Code: [Select] if [[ -z$TEST ]]then    command    if [ \$? -ne 0 ]    then        # This is a very long comment line that reaches all the way to column        # 80 and then some.    fifi
Title: Re: Does reflow comment work with Unix shell scripts?
Post by: Clark on June 22, 2019, 12:25:12 am
Reflow Comment isn't supported for shell scripting languages yet and the menu item should be disabled but isn't (bug).

Looks like Reflow Comment is broken if Comment Wrap is off. Reflow Comment should work for say C++ which supports Comment Wrap even if Comment Wrap is off.

We will add hot fixes for this
Title: Re: Does reflow comment work with Unix shell scripts?
Post by: timur on June 22, 2019, 03:21:03 am
Could you add comment reflow for other languages?  If you can reflow // comments in C++, then surely it wouldn't be too difficult to reflow # comments in Bash.
Title: Re: Does reflow comment work with Unix shell scripts?
Post by: Clark on June 22, 2019, 06:20:16 pm
I've added reflow_comment support for almost all languages SlickEdit supports. I was able to add support for Shell scripting languages (took some hardwired code though).

Title: Re: Does reflow comment work with Unix shell scripts?
Post by: hs2 on June 22, 2019, 07:35:27 pm
Wow Clark .. ++HP ;D
Title: Re: Does reflow comment work with Unix shell scripts?
Post by: guth on June 22, 2019, 08:08:35 pm
Talking about reflow, would it be possible to make reflow context aware in LaTeX documents? For instance, having the cursor on an \item in a \begin{itemize}\end{itemize} environment, reflow only reflows the current \item and not the current paragraph, as seen by slickedit.
Code: [Select]
\begin{itemize}\item a very long line and we want it to be reflowed at, say, 80th column, so after a relow, the item shall be like below.\item a very long line and we want it to be reflowed at, say, 80th column, soafter a relow, the item shall be like below.\end{itemize}
but doing a reflow paragraph having the cursor on the second line, i.e., somewhere on the first \item, the result is as follow:
Code: [Select]
\begin{itemize} \item a very long line and we want it to be reflowed at, say, 80th column, so after a relow, the item shall be like below. \item a very long line and we want it to be reflowed at, say, 80th column, so after a relow, the item shall be like below. \end{itemize}
Title: Re: Does reflow comment work with Unix shell scripts?
Post by: Clark on June 23, 2019, 12:39:46 am
I think it’s doable but I’m not that familiar with latex. As a work around, you can reflow a selection.