<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Ivan,</p>
<p><br>
</p>
<p>take a look at this one:
<a class="moz-txt-link-freetext" href="https://clang.llvm.org/doxygen/classclang_1_1Lexer.html#a9102a4b3ccbed3505f6d002502193793">https://clang.llvm.org/doxygen/classclang_1_1Lexer.html#a9102a4b3ccbed3505f6d002502193793</a></p>
<p>The Lexer provides a function that gives the indendation for a
line, given that you seem to know the line of interest you can
probably query the Lexer there.</p>
<p><br>
</p>
<p>Best Jonas<br>
</p>
<br>
<div class="moz-cite-prefix">Am 05.10.2018 um 13:31 schrieb Ivan
Donchevskii via cfe-dev:<br>
</div>
<blockquote type="cite"
cite="mid:DB6PR0201MB227808479C46334C65736A1D8CEB0@DB6PR0201MB2278.eurprd02.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" dir="ltr" style="">
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
Hi,</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
libFormat and clang-format are great for formatting but I want
to use libFormat a bit differently - to provide
the indentation for the next line (inside IDE, when you press
CR in code editor).</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
Probably I miss some handy flag which helps with that but so
far I've found only workarounds to do what I need:</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<span style="font-size: 12pt;"> - add some
stupid expression to the new line<span style="font-family:
Calibri, Helvetica, sans-serif, EmojiFont, "Apple
Color Emoji", "Segoe UI Emoji",
NotoColorEmoji, "Segoe UI Symbol", "Android
Emoji", EmojiSymbols; font-size: 16px;"> (something
like "</span><span style="font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 16px;">a;")</span> to force libFormat indent it</span><br>
</p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<span style="font-size: 12pt;"> - play with clang-format flags
to prevent it from shrinking the new line into the previous
one</span></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<span style="font-size: 12pt;"> - set ColumnLimit to the
length of the previous line also to prevent shrinking</span></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<span style="font-size: 12pt;"><br>
</span></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<span style="font-size: 12pt;">All of them work completely
unreliably. Also it's often some incomplete code in the
middle of typing so it might have unfinished expressions.</span></p>
<p style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica,
sans-serif, EmojiFont, "Apple Color Emoji",
"Segoe UI Emoji", NotoColorEmoji, "Segoe UI
Symbol", "Android Emoji", EmojiSymbols;
font-size: 12pt; margin-top: 0px; margin-bottom: 0px;">
<span style="font-size: 12pt;"><br>
</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span
style="font-size: 12pt;">So I want to ask if somebody
has/had similar
</span>use cases<span style="font-size: 12pt;"> and knows how
to deal with them before adding some special flag to
clang-format and trying to solve my issues there.</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span
style="font-size: 12pt;"><br>
</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span
style="font-size: 12pt;">Kind regards,</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span
style="font-size: 12pt;">Ivan</span></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>