This was an important item for me under the File menu, but so far i cannot find it in 2.0.1.
Thanks, I tried to do the same as you but still no change. I renamed this file:
C:\Users\terry.arduinoIDE\recent-sketches.json.bak
Was that what you meant?
Exactly which file (the full path/name) did you rename ?
As you will see in the other topic
I took the easy way out and nuked the JSON file which solved my problem
I gave it in my reply!
C:\Users\terry.arduinoIDE\recent-sketches.json.bak
I assume that is a typo and that it should be
C:\Users\terry.arduinoIDE\recent-sketches.json.bak
They seem identical to me, apart from the bold format I gave to 'bak'?
I didn't think a PC reboot should be necessary - but pleased to report that after doing so as a last resort and then opening an .ino, Open Recent was back.
The forum software is removing the backslash after your username and before the full stop, thus confusing what we are posting and what we are reporting
Anyway, you now seem sorted
Yes and no. Have the rules changed in 2.0.1 for how Open Recent gets populated?
I've run several sketches from Examples but they have not appeared in the list to join the one I opened earlier via File > Open. If that's by design, why?
Have you switched to v2?
I have seen recent mention of the fact that 2.0 does not show example sketches in the recent files list but I cannot remember where or why it has changed
@pert can you please advise ?
I am using 2.0.1 and the classic IDE in a mix an match fashion. I like the ideas in 2.0 and it seems to be coming together but has some way to go. My main reasons for not using 2.0 more were the lack of easily configurable Auto Format, unlike the classic IDE and the fact that I could not alter the default sketch when starting a new sketch. Both now sorted
Some simple things still annoy me such as no "Copy for Forum", "Select All" or "Auto Format" on the right click menu, which are useful when dealing with code from the forum or uploading code to it. 2.0.1 also seems to lose track of my COM ports from time to time which is a nuisance. That may be because they are on a USB hub but the classic IDE had no problem with that
I have recently been using a more fully featured IDE when teaching myself Python and can see where the Arduino IDE is headed. Ironically the Python IDE has so many features that it is sometimes complicated to find the one that you want
Example sketches are read only and are kept in a temporary folder while you mess around with them. They are not added to the recent folders list. Do a "Save as.." with some of them and they should show.
Edit: @UKHeliBob beat me. I need to learn to type faster.
Hadn't noticed that. Can you point me to the fix please? Lining up my curly brackets is a must for me. I see Ctrl+t no longer does it.
EDIT: I've quickly read the thread
https://forum.arduino.cc/t/auto-format-settings/698381/17
Looks like hard work. I'll stick with 1.18.9 until I see a simple solution. Shame, but I must keep my curlies vertically aligned!
Thanks. That's a negative change for me. At this stage of my learning I frequently use Examples. Initial choice can be slowish (my mouse cursor slips easily off target), and Open Recent offers fast subsequent access.
Auto Format now uses the delightfully named clang formatting. IDE 2.0 comes with a default clang-format file that defines what happens when you use Auto Format. The settings in that file can be overridden by a clang-format file placed in the C:\Users<username>\.arduinoIDE folder and this in turn can be overridden by a clang-format file placed in the sketch folder
With a name like that this may seem like an out of place April fools joke, but it is all true. Read up on clang formatting for the gory details of all the settings that you can play with and/or search the 2.0 section of the forum for the word clang
If it is or any use to you, here is my clang-format file
#default format originally from
#https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-customize-auto-formatter
---
Language: Cpp
# LLVM is the default style setting, used when a configuration option is not set here
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: false
AlignEscapedNewlines: DontAlign
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: No
BinPackArguments: true
BinPackParameters: true
# Only used when "BreakBeforeBraces" set to "Custom"
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
#AfterObjCDeclaration:
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
# Java-specific
#BreakAfterJavaFieldAnnotations:
BreakBeforeBinaryOperators: NonAssignment
# bbb BreakBeforeBraces: Attach
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: false
ColumnLimit: 0
# "" matches none
CommentPragmas: ""
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: true
DisableFormat: false
# Docs say "Do not use this in config files". The default (LLVM 11.0.1) is "false".
#ExperimentalAutoDetectBinPacking:
FixNamespaceComments: false
ForEachMacros: []
IncludeBlocks: Preserve
IncludeCategories: []
# "" matches none
IncludeIsMainRegex: ""
IncludeIsMainSourceRegex: ""
IndentCaseBlocks: true
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
# Java-specific
#JavaImportGroups:
# JavaScript-specific
#JavaScriptQuotes:
#JavaScriptWrapImports
# bbb KeepEmptyLinesAtTheStartOfBlocks: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
# Set to a large number to effectively disable
# bbb MaxEmptyLinesToKeep: 10000000
MaxEmptyLinesToKeep: 0
NamespaceIndentation: None
NamespaceMacros: []
# Objective C-specific
#ObjCBinPackProtocolList:
#ObjCBlockIndentWidth:
#ObjCBreakBeforeNestedBlockParam:
#ObjCSpaceAfterProperty:
#ObjCSpaceBeforeProtocolList
PenaltyBreakAssignment: 1
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 1
PenaltyBreakFirstLessLess: 1
PenaltyBreakString: 1
PenaltyBreakTemplateDeclaration: 1
PenaltyExcessCharacter: 1
PenaltyReturnTypeOnItsOwnLine: 1
# Used as a fallback if alignment style can't be detected from code (DerivePointerAlignment: true)
PointerAlignment: Right
RawStringFormats: []
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
StatementMacros: []
TabWidth: 2
TypenameMacros: []
# Default to LF if line endings can't be detected from the content (DeriveLineEnding).
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros: []
It has a link to the default file and the changes that I have made to the default are all flagged with a comment containing bbb so are easy to find
Please feel free to ask questions about clang formatting but I guarantee that I won't know the answer
Many thanks. Must have posted my EDIT at the same time. I'll try your file at the earliest opportunity. I did download Virtual Studio but don't relish learning it.
That's a relief, your file in place and my brackets line up, thanks a bunch. ![]()
Will study your file for other changes soon but that was the big one for me!
I not only like the brackets lined up but also each on their own line which to me shows the sketch structure more clearly. When examining code downloaded from the forum this shows up mismatched pairs of braces immediately which is a common problem. Often the brace at the end of the loop() function is displaced to the end of the sketch or goes missing entirely
It wasn't an intentional change. It is a side effect of the mechanism Arduino IDE 2.x uses to prevent the user from making unintentional edits to the original example sketch files. As Willem43 already explained, this is done by opening a copy of the example sketch, staged in a temporary folder (just like how it is done when you use File > New). These temporary sketches are not stored in the "Open Recent" menu because the operating system may clean the temporary folder between IDE sessions (Windows does not, but Linux does).
There is work in progress to make the IDE list example sketches in the "Open Recent" menu:
clang stands for "C Language".
(it is for all C-ish languages, not C alone)
Thanks Per. I could not remember the context in which I had seen it