Description, because “alt text” can’t show it well:

			{
				emit differentFiles (ckFile.absoluteFilePath(),
					otherFile.absoluteFilePath(),
					FileCompareWorker::FileComparisonParams{FileComparisonParams::FileNameMatch,
						(ckFile.size() > otherFile.size()) ? FileComparisonParams::File1IsLarger
							: FileComparisonParams::File2IsLarger});
			}

After Alignment

			{
				emit differentFiles (ckFile.absoluteFilePath(),
					otherFile.absoluteFilePath(),
					FileCompareWorker::FileComparisonParams{FileComparisonParams::FileNameMatch,
						(ckFile.size() > otherFile.size()) ? FileComparisonParams::File1IsLarger
														   : FileComparisonParams::File2IsLarger});
			}
  • The Quuuuuill@slrpnk.net
    link
    fedilink
    English
    arrow-up
    22
    ·
    2 months ago

    Not random. This is a pretty common standard for most style guides that if you split a ternary operator across lines you align the option colon to the ternary itself. Your alt text formatting is way different from the pic by the way

    • ulterno@programming.devOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 months ago

      Your alt text formatting is way different from the pic by the way

      Hmm.
      I really just copied the stuff directly. Let me try again.

      pretty common standard

      I get it. But I set all available “Align” flags to false and am still getting this.
      I just want a simple thing that only does continuation indents. If there is a space added, it should be something according to the coder (Is what I mean by indents only). though not even that, because all spaces before the first character in the line are to be removed.


      Not random

      Well, I guess I’ll go put a better word in there

  • Flipper@feddit.org
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    2 months ago

    You shouldn’t use tabs for alignment. It breaks for everyone with a different tab size.

    • ulterno@programming.devOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 months ago
      1. I am using tabs for INDENTATION. I don’t want alignment.
      • I have tried my best to remove all alignment operations of clang-format
      1. What do you use tabs for?
    • mmddmm@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      2 months ago

      You shouldn’t align code anyway.

      If it’s important to have stuff on the same column, make it an indentation level and add a line break where it starts.

  • Lucien [he/him]@mander.xyz
    link
    fedilink
    arrow-up
    5
    ·
    2 months ago

    Like the other commented said, this isn’t random, but also I’d add that your first ternary option, the ?, should be on the next line; it would make the alignment make more sense to you then, and it would make the block more legible.

    • ulterno@programming.devOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      2 months ago

      I think I’d rather go with the ? being on the same line as the ‘condition’ and the rest can go on the other line.

      Otherwise, I’d be looking one line downwards and then coming back up after realising that it is a (cond)?ex:ex operator.


      And I get that it’s not random, just that I asked for it at as many places as possible to not do alignment.
      And from what I can recall, I had managed to make stuff work with the older clang-formats…
      Or maybe not. Maybe this kind of code never went through it.

  • ulterno@programming.devOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    BTW, I changed my code to avoid the formatting:

    {
    	if (ckFile.size() > otherFile.size())
    	{
    		emit differentFiles (ckFile.absoluteFilePath(),
    			otherFile.absoluteFilePath(),
    			FileCompareWorker::FileComparisonParams{
    				FileComparisonParams::FileNameMatch, FileComparisonParams::File1IsLarger});
    	}
    	else
    	{
    		emit differentFiles (ckFile.absoluteFilePath(),
    			otherFile.absoluteFilePath(),
    			FileCompareWorker::FileComparisonParams{
    				FileComparisonParams::FileNameMatch, FileComparisonParams::File2IsLarger});
    	}
    }
    

    BTW, here is my .clang-format in case you are interested

  • MNByChoice@midwest.social
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    Seems like a lot of work, when the font I use will mess it up. And compiler/interpreter won’t care.

    But if it makes you happy, go for it.