bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Feature Request] Preserving multiple assignment operations on separate


From: jvroutak
Subject: [Feature Request] Preserving multiple assignment operations on separate lines
Date: Thu, 6 Mar 2008 06:14:36 -0800 (PST)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]