jamesjuett / lobster

Interactive Program Visualization Tools
8 stars 3 forks source link

Spacing in simulated code for ctor-initializer-lists #297

Open jamesjuett opened 2 years ago

jamesjuett commented 2 years ago

Repro code:

#include <iostream>

using namespace std;

class A {
  A(int x) { cout << x << endl; }
};

class B : public A {
  B(int x) : A(x) { cout << "b" << endl; }
};

int main() {
  cout << "Hello World!" << endl;
  B b(3);
}

In the simulation, an awkward large space appears before the following {. I checked in dev tools and it appears that removing a the trailing space from the html for the ctor-initializer-list fixes the issue.

image