[Feature Request] Preserving multiple assignment operations on separate lines

jvroutak <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
Hi

I'm using indent 2.2.9 on Windows platform.

I tried to search for solutions to the mentioned problem from the mailing
list, man pages and the internet with no luck.

The problem is that we have C source code with formatting like this:

  wnd->txd   = Query(mos->som ,_TX);
  host->rxd  =
  ptu->rxd   =
  wnd->rxd   =
  inp->rxd   =
  heat->rxd  =
  rain->rxd  =
  txd->rxd   = Query(mos->som ,_RX);
  rxd->rain  =
  host->rain = Query(mos->som ,_RN);

The assignment operations line up nicely and the code is easy to read. What
happens when we put this through indent:

    wnd->txd = Query(mos->som, _TX);
  host->rxd =
    ptu->rxd = wnd->rxd = inp->rxd = heat->rxd = rain->rxd = txd->rxd =
Query(mos->som, _RX);
  rxd->rain = host->rain = Query(mos->som, _RN);

One hack around this is to add comments after each line like this:

 rxd->ht = Query(mos->som, _HT);
  host->txd =                   //
    rain->txd =                 //
    rxd->txd =                  //
    inp->txd =                  //
    heat->txd =                 //
    ptu->txd =                  //
    wnd->txd = Query(mos->som, _TX);

But then the lines or assignment signs are no longer lined up, and I'd have
to add the comments after each line, so it's not an optimal solution.

Any ideas, or am I out of luck?

-Juho Routakorpi
-- 
View this message in context: http://www.nabble.com/-Feature-Request--Preserving-multiple-assignment-operations-on-separate-lines-tp15873145p15873145.html
Sent from the Gnu - Indent Tool mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.