GithubHelp home page GithubHelp logo

Comments (2)

davydden avatar davydden commented on August 26, 2024

@welkineins any idea what can be wrong?

from vscode-astyle.

chance86 avatar chance86 commented on August 26, 2024

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:

screen shot 2018-03-14 at 17 59 55

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.