Author Topic: Contextual menu extension to reindent parameter lists  (Read 2907 times)

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 888
  • Liked:
  • Likes Given: 10
Contextual menu extension to reindent parameter lists
« on: December 02, 2019, 08:27:50 AM »
I wrote a contextual menu extension to reindent parameter lists.

Before:
Code: [Select]
Bool Read(n1 x,
       n1 y,
             n1 z)
{
    if (!Read("\pInput (many)",
                m_save,
           k))
        {
        Return_false("\pError (-110)",
                       k);
        }
    /* Test(a,
          b); */
    Test(a,
       b);
    // Test(a,
    //    b);
    Test(a,
      b);
    Test(A(x,
      y),
             B(z,
                 w));
    return True;
}

After:
Code: [Select]
Bool Read(n1 x,
          n1 y,
          n1 z)
{
    if (!Read("\pInput (many)",
              m_save,
              k))
        {
        Return_false("\pError (-110)",
                     k);
        }
    /* Test(a,
          b); */
    Test(a,
         b);
    // Test(a,
    //    b);
    Test(a,
         b);
    Test(A(x,
           y),
         B(z,
           w));
    return True;
}

At this moment it contains 512 K of zeroes.
I'll try to make a smaller version.

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 888
  • Liked:
  • Likes Given: 10
Re: Contextual menu extension to reindent parameter lists
« Reply #1 on: December 08, 2020, 11:03:01 AM »
See the smaller version in the attachment.

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 888
  • Liked:
  • Likes Given: 10
Re: Contextual menu extension to reindent parameter lists
« Reply #2 on: December 23, 2020, 04:31:37 AM »
Zero downloads? Thatís one of my best softwares ever.

Offline Daniel

  • Gold Member (200+ Posts)
  • *****
  • Posts: 299
  • Programmer, Hacker, Thinker
  • Liked:
  • Likes Given: 10
Re: Contextual menu extension to reindent parameter lists
« Reply #3 on: December 23, 2020, 08:51:04 AM »
Sadly, our greatest achievements are often completely useless for end users.

Offline Jubadub

  • Gold Member (200+ Posts)
  • *****
  • Posts: 214
  • New Member
  • Liked:
  • Likes Given: 6
Re: Contextual menu extension to reindent parameter lists
« Reply #4 on: December 25, 2020, 05:50:52 AM »
What are parameter lists used for? What are the benefits of reindenting them?

Depending on the answers to these 2 questions, it may get a lot more downloads. :)

EDIT: Typo fix.
« Last Edit: December 25, 2020, 08:58:37 AM by Jubadub »

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 888
  • Liked:
  • Likes Given: 10
Re: Contextual menu extension to reindent parameter lists
« Reply #5 on: December 25, 2020, 07:22:39 AM »
A parameter list is a part of a function prototype or a function call in a programming language. (This forum is about programming, remember?) We like to place the parameters neatly in one column, one parameter per line. This costs effort typing many spaces, so itís helpful when this is done automatically.

Offline Jubadub

  • Gold Member (200+ Posts)
  • *****
  • Posts: 214
  • New Member
  • Liked:
  • Likes Given: 6
Re: Contextual menu extension to reindent parameter lists
« Reply #6 on: December 25, 2020, 09:04:03 AM »
I see, a parameter list, as in, the list of arguments to be passed onto a method within code in a text file of your choosing. For general code text identation. I see, my bad for not looking at the "Before" and "After" boxes carefully.

Yeah, that's cool, although I would personally not split my parameters with one per line... But still, that's a nice little CM. Does the ".sitx" also include the source?

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 888
  • Liked:
  • Likes Given: 10
Re: Contextual menu extension to reindent parameter lists
« Reply #7 on: December 25, 2020, 09:10:21 AM »
No, no source.

Offline OS923

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 888
  • Liked:
  • Likes Given: 10
Re: Contextual menu extension to reindent parameter lists
« Reply #8 on: January 21, 2021, 07:31:27 AM »
Thereís a bug where it doesnít save the new text because the length is the same. Thereís a small chance that this happens. This is already fixed for the next version.

 


SimplePortal 2.3.6 © 2008-2014, SimplePortal