Skip to content

Apostrophe in comment reduces indentation level on auto-indent #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wbt opened this issue Feb 20, 2018 · 0 comments
Open

Apostrophe in comment reduces indentation level on auto-indent #16

wbt opened this issue Feb 20, 2018 · 0 comments

Comments

@wbt
Copy link

wbt commented Feb 20, 2018

Both of the following were auto-indented by Atom (with four spaces per indent for visual clarity).
This code looks properly indented:

pragma solidity ^0.4.0;
library RecordsLib { //you wouldnt expect this apostrophe to affect indentation!
    struct Data {
        uint timestamp;
        uint score;
    }
    function updateRecord(Data storage self, uint newTimestamp, uint newScore) public {
        self.timestamp = newTimestamp;
        self.score = newScore;
    }
}

This code does not:

pragma solidity ^0.4.0;
library RecordsLib { //you wouldn't expect this apostrophe to affect indentation!
struct Data {
    uint timestamp;
    uint score;
}
function updateRecord(Data storage self, uint newTimestamp, uint newScore) public {
    self.timestamp = newTimestamp;
    self.score = newScore;
}
}

and the only difference between them is a commented-out apostrophe, on a line after an open brace!

I noticed the same issue in javascript and the issue may generalize beyond this package, but my last attempts at opening auto-indent issues on Atom got moved to language-specific packages (so I'm starting out there with these reports).

Versions

Atom: 1.23.2
Electron: 1.6.15
Chrome: 56.0.2924.87
Node: 7.4.0
language-ethereum: 0.3.9
language-javascript: 0.127.6
OS : Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant