I am having some trouble with clang-format and blocks. I'd like to maintain the following format for method invocation with trailing blocks:
[self presentViewController:alertController animated:YES completion:^{
NSLog(#"Output");
// Do something
}];
I have set ColumnLimit to 0, which works everywhere, but it has the side effect of not formatting anything within the block (if statements, other invocation, etc.). The only way to get code inside blocks formatted, that I can find, is to set ColumnLimit to > 0, however, even if I set it to something huge like 100000, it adds breaks to every argument, which I do not want:
[self presentViewController:alertController
animated:YES
completion:^{
NSLog(#"Output");
// Do something
}];
So, the combination I want is for code within blocks to be properly formatted while not touching anything else about the method invocation.
My clang-format config:
Language: Cpp
ColumnLimit: 0
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
IndentWidth: 4
TabWidth: 4
UseTab: Never
PointerAlignment: Right
DerivePointerAlignment: false
ObjCSpaceAfterProperty: true
BreakBeforeBraces: Stroustrup
AllowShortIfStatementsOnASingleLine: false
BreakBeforeTernaryOperators: false
IndentCaseLabels: true
AllowShortCaseLabelsOnASingleLine: false
AlignTrailingComments: true
BinPackParameters: false
BinPackArguments: false
AllowShortFunctionsOnASingleLine: false
IndentWrappedFunctionNames: false
ObjCSpaceBeforeProtocolList: true
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpaceBeforeAssignmentOperators: true
SpacesBeforeTrailingComments: 1
ObjCBlockIndentWidth: 4
Clang format version is 3.6.
Any help would be great, not sure if this is possible to achieve.
Related
clang-format version 15.0.6
Question> Which settings I can use to get the expected format shown below?
Thank you
What I see:
auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();
What I expect:
auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();
My current settings for Break:
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ObjCBreakBeforeNestedBlockParam: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
I think you haven't set the option ColumnLimit. By default, it is set to 80. Try setting that manually, or if you don't want it to wrap, then set it to 0.
Without setting ColumnLimit:
auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();
After setting ColumnLimit: 0:
auto amount =
msg[AAAAAAAAAAAAAAAAAAAAAAAAA::bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]
.get<double>();
WKWebView. ScrollerView. Bounces = false
ios12 works but in ios14 doesn't work, how can I solve
These worked for me,try
webView.scrollView.alwaysBounceHorizontal = false
webView.scrollView.alwaysBounceVertical = false
webView.scrollView.bounces = false
How do you disable zoom for iOS Charts but not completely stop user interaction? For example, still using the highlight tap. This takes care of the zoom, but it disables everything else as well.
chartView.userInteractionEnabled = false
To disable zoom, but not impact other chart interaction, make these adjustments:
chartView.doubleTapToZoomEnabled = false
chartView.pinchZoomEnabled = false
chartView.scaleXEnabled = false
chartView.scaleYEnabled = false
dataGrouping: {
enabled: true,
forced: true
}
imgur.com/oLD44Rm
dataGrouping: {
enabled: true,
forced: false
}
imgur.com/Mo0eE2O
Highcharts large data grupperom well if forced enabled. I found a gap where the data has a large gap. You can leave and forced to remove the gap?
UPDATE:
I found this: xAxis.ordinal: false, and series.dataGrouping.forced: true = gap.
http://jsfiddle.net/vj3kynqc/1/
I want to leave xAxis.ordinal: false :)
How to do it without gap the line?
In a float-layout, or when having windows floating in any other layout, it is impossible to move/resize them when they're maximized. I would however like to be able to drag/resize them out of the maximized state. This doesn't seem to work:
awful.button({ modkey }, 1,
function (c)
-- I added the if-statement
if c.maximized then
c.maximized_horizontal = false
c.maximized_vertical = false
end
awful.mouse.client.move(c)
end
)
Has anyone encountered this or anything similar?
For awesome v3.5.2 this thing works:
awful.button({ modkey }, 1,
function (c)
c.maximized_horizontal = false
c.maximized_vertical = false
awful.mouse.client.move(c)
end)
I'm on awesome 3.5.6, and a similar thing works great for me:
awful.button({ modkey }, 1,
function (c)
c.maximized_horizontal = false
c.maximized_vertical = false
c.maximized = false
c.fullscreen = false
awful.mouse.client.move(c)
end)
I'm not sure if putting the maximized_horizontal/vertical rules in addition to maximized is redundant or not, but this combined with c.fullscreen works on everything, and it's quite handy =)