Code Monkey home page Code Monkey logo

Comments (3)

NatalieWolfe avatar NatalieWolfe commented on August 18, 2024

👍

I encounter this all the time with constructors with initializer lists but no body, like this:

future::future( const typename promise_type::shared_state_ptr_type& state ):
    m_state( state )
{}

from language-c.

muppetjones avatar muppetjones commented on August 18, 2024

I've been having a ton of trouble with indentation issues across atom, and I opened an issue Initial post here.

I've been coding in python lately, but it seems to extend beyond python:

void main() {
  bool does_indentation_work = 1;
  if (does_indentation_work) {
    printf("woot");
  } else {
    printf("ugh");
  }

  if (alternate_style_indentation)
  {
    printf('still works');
  }

  else {
    printf('hmmm...');
  }

  int test_function = function_with_param(this_param,
  that_param
); // strange dedent after typing semicolon

  int test_function = function_with_param(
    this_param,
    that_param
  );

  int test_function = function_with_proper_indent(param1,
                                                  param2,
                                                ); // strange dedent again
                                                uh_oh = 1;

                                                still_after_blank_line = 1;

  return;                                                
}

from language-c.

chfritz avatar chfritz commented on August 18, 2024

I'm working on this. Unfortunately it is quite hard to get my pull request accepted because of some disagreements on which is the lesser evil in a case where not all requirements can be met.

For now what I have done is to go with a monkey-patching approach, i.e., you can adopt (and thereby vote) for my new logic by installing this package:
https://atom.io/packages/sane-indentation

It produces:

struct rec {
    char id[26];
    struct year *ptr; };

struct year {
    int year;
    struct year *next;
    struct day *ptr; };

struct day {
    int day;
    double expenses;
    struct movie *ptr;
    struct day *next; };

struct movie {
    char id[5];
    struct movie *next; };

and

void main() {
  bool does_indentation_work = 1;
  if (does_indentation_work) {
    printf("woot");
  } else {
    printf("ugh");
  }

  if (alternate_style_indentation)
  {
    printf('still works');
  }

  else {
    printf('hmmm...');
  }

  int test_function = function_with_param(this_param,
    that_param
  ); // strange dedent after typing semicolon

  int test_function = function_with_param(
    this_param,
    that_param
  );

  int test_function = function_with_proper_indent(param1,
    param2,
  ); // strange dedent again
  uh_oh = 1;

  still_after_blank_line = 1;

  return;                                                
}

which looks sane to me :-)

If you do install the package and run into any issues, please let me know so I can address them. I believe I may be the only one working on indentation right now.

from language-c.

Related Issues (20)

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.