One of the funniest pieces of code.

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–38 unchanged (38 lines)
39 if (e == bgProperty)
40 {
41 self->_backgroundChanged(self->Background());
42 }
43 }
44 });
45 }
46
47 double TitlebarControl::CaptionButtonWidth()
48 {
49 // Divide by three, since we know there are only three buttons. When
50 // Windows 12 comes along and adds another, we can update this /s
51 static auto width{ MinMaxCloseControl().ActualWidth() / 3.0 };
52 return width;
53 }
54
55 IInspectable TitlebarControl::Content()
56 {
57 return ContentRoot().Content();
58 }
…lines 59–191 unchanged (133 lines)

After

…lines 1–38 unchanged (38 lines)
39 if (e == bgProperty)
40 {
41 self->_backgroundChanged(self->Background());
42 }
43 }
44 });
45 }
46
47 float TitlebarControl::CaptionButtonWidth()
48 {
49 // Divide by three, since we know there are only three buttons. When
50 // Windows 12 comes along and adds another, we can update this /s
51 const auto minMaxCloseWidth = MinMaxCloseControl().ActualWidth();
52 return static_cast<float>(minMaxCloseWidth) / 3.0f;
53 }
54
55 IInspectable TitlebarControl::Content()
56 {
57 return ContentRoot().Content();
58 }
…lines 59–191 unchanged (133 lines)

Before

translation_unit
comment "// Copyright (c) Microsoft Corporation.\r"
comment "// Licensed under the MIT license.\r"
comment "//\r"
comment "// Implementation of the TitlebarControl class\r"
comment "//\r"
preproc_include
#include "#include"
string_literal
" "\""
string_content "pch.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "TitlebarControl.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "ColorHelper.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "TitlebarControl.g.cpp"
" "\""
namespace_definition
namespace "namespace"
nested_namespace_specifier
namespace_identifier "winrt"
:: "::"
nested_namespace_specifier
namespace_identifier "TerminalApp"
:: "::"
namespace_identifier "implementation"
declaration_list
{ "{"
function_definition (+255 nodes collapsed)
function_definition
primitive_type "double"
function_declarator
qualified_identifier
namespace_identifier "TitlebarControl"
:: "::"
identifier "CaptionButtonWidth"
parameter_list
( "("
) ")"
compound_statement
{ "{"
comment "// Divide by three, since we know there are only three butto"...
comment "// Windows 12 comes along and adds another, we can update th"...
declaration
storage_class_specifier
static "static"
placeholder_type_specifier
auto "auto"
init_declarator
identifier "width"
initializer_list
{ "{"
binary_expression
call_expression
field_expression
call_expression
identifier "MinMaxCloseControl"
argument_list
( "("
) ")"
. "."
field_identifier "ActualWidth"
argument_list
( "("
) ")"
/ "/"
number_literal "3.0"
} "}"
; ";"
return_statement
return "return"
identifier "width"
; ";"
} "}"
function_definition (+28 nodes collapsed)
function_definition (+31 nodes collapsed)
function_definition (+138 nodes collapsed)
function_definition (+159 nodes collapsed)
function_definition (+57 nodes collapsed)
function_definition (+60 nodes collapsed)
function_definition (+77 nodes collapsed)
function_definition (+65 nodes collapsed)
function_definition (+31 nodes collapsed)
comment "// GH#9443: HoverButton, PressButton, ClickButton and Releas"...
comment "// used to manually interact with the buttons, in the same w"...
comment "// would normally send events.\r"
function_definition (+31 nodes collapsed)
function_definition (+31 nodes collapsed)
function_definition (+153 nodes collapsed)
function_definition (+27 nodes collapsed)
function_definition (+227 nodes collapsed)
} "}"

After

translation_unit
comment "// Copyright (c) Microsoft Corporation.\r"
comment "// Licensed under the MIT license.\r"
comment "//\r"
comment "// Implementation of the TitlebarControl class\r"
comment "//\r"
preproc_include
#include "#include"
string_literal
" "\""
string_content "pch.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "TitlebarControl.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "ColorHelper.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "TitlebarControl.g.cpp"
" "\""
namespace_definition
namespace "namespace"
nested_namespace_specifier
namespace_identifier "winrt"
:: "::"
nested_namespace_specifier
namespace_identifier "TerminalApp"
:: "::"
namespace_identifier "implementation"
declaration_list
{ "{"
function_definition (+255 nodes collapsed)
function_definition
primitive_type "float"
function_declarator
qualified_identifier
namespace_identifier "TitlebarControl"
:: "::"
identifier "CaptionButtonWidth"
parameter_list
( "("
) ")"
compound_statement
{ "{"
comment "// Divide by three, since we know there are only three butto"...
comment "// Windows 12 comes along and adds another, we can update th"...
declaration
type_qualifier
const "const"
placeholder_type_specifier
auto "auto"
init_declarator
identifier "minMaxCloseWidth"
= "="
call_expression
field_expression
call_expression
identifier "MinMaxCloseControl"
argument_list
( "("
) ")"
. "."
field_identifier "ActualWidth"
argument_list
( "("
) ")"
; ";"
return_statement
return "return"
binary_expression
call_expression
template_function
identifier "static_cast"
template_argument_list
< "<"
type_descriptor
primitive_type "float"
> ">"
argument_list
( "("
identifier "minMaxCloseWidth"
) ")"
/ "/"
number_literal "3.0f"
; ";"
} "}"
function_definition (+28 nodes collapsed)
function_definition (+31 nodes collapsed)
function_definition (+138 nodes collapsed)
function_definition (+159 nodes collapsed)
function_definition (+57 nodes collapsed)
function_definition (+60 nodes collapsed)
function_definition (+77 nodes collapsed)
function_definition (+65 nodes collapsed)
function_definition (+31 nodes collapsed)
comment "// GH#9443: HoverButton, PressButton, ClickButton and Releas"...
comment "// used to manually interact with the buttons, in the same w"...
comment "// would normally send events.\r"
function_definition (+31 nodes collapsed)
function_definition (+31 nodes collapsed)
function_definition (+153 nodes collapsed)
function_definition (+27 nodes collapsed)
function_definition (+227 nodes collapsed)
} "}"