Comments (2)
@welkineins any idea what can be wrong?
from vscode-astyle.
I have a custom
astylerc
file which works flawlessly with[email protected]
from the command line.However, when I use the plugin and provide
"astyle.executable": "<blabla>", "astyle.astylerc": "<blabla>", "C_Cpp.formatting" : "Disabled"
I see interesting behaviour that each invocation of formatting adds a new line:
p.s. macOS
10.13.3
,[email protected]
,[email protected]
.
I have this problem, too. However, this problem only appears in [email protected]
. There does not have this problem in [email protected]
.
Refer to the differences between the two versions. This is my patch for [email protected]
to fix this bug:
diff -urN astyle_2.04_original/src/astyle_main.cpp astyle_2.04_fix/src/astyle_main.cpp
--- astyle_2.04_original/src/astyle_main.cpp 2013-11-02 04:31:48.000000000 +0800
+++ astyle_2.04_fix/src/astyle_main.cpp 2019-11-18 16:02:16.934246960 +0800
@@ -435,10 +435,11 @@
istream* inStream = &cin;
stringstream outStream;
char ch;
- while (!inStream->eof())
+ inStream->get(ch);
+ while (!inStream->eof() && !inStream->fail())
{
- inStream->get(ch);
outStream.put(ch);
+ inStream->get(ch);
}
ASStreamIterator<stringstream> streamIterator(&outStream);
// Windows pipe or redirection always outputs Windows line-ends.
from vscode-astyle.
Related Issues (19)
- Fail to format centain file HOT 4
- Can't find astyle. (astyle) HOT 1
- Reload or restart vscode after setting updated
- --dry-run isn't supported
- not work in an unsave new file HOT 1
- astyle selected code HOT 1
- Cannot process the input stream HOT 1
- Request for Command Line Options HOT 2
- asytle configuration do not show up in Settings
- Different output with cmd and vscode
- astyle doesn't work on VSCode 1.44 "format selection"
- use specific astyle option file instead of “cmd_options” in workspace if had set "astyle.astylerc"
- not working (conflict with clang-formatter in cpptool package) HOT 6
- Support ${workspaceRoot} variable substitution in all options HOT 1
- Allow for use with arbitrary languages HOT 9
- does upgrade 1.9 of vscode broke the plugin HOT 12
- Failed to launch astyle on format HOT 1
- There is always a extra "}" at the end of the file after formatting.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-astyle.