Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Comments

Fixing indentation on empty brackets with trailing comma/colon (issue #42)#56

Open
yohannd1 wants to merge 1 commit intoziglang:master from
yohannd1:trailing-comma-brackets-fix
Open

Fixing indentation on empty brackets with trailing comma/colon (issue #42) #56
yohannd1 wants to merge 1 commit intoziglang:master from
yohannd1:trailing-comma-brackets-fix

Conversation

@yohannd1
Copy link
Contributor

@yohannd1 yohannd1 commented Jun 13, 2021

An attempt on fixing what #42 reports.

I'm not yet sure if this fully fixes the issue. I'll be testing it more on the following days and will report any issue I find.

I'm not fully sure if this fixes, it. Still experimenting.
if currentLine =~ '\v^\s*}\s*[,;]?\s*$'
return indent(prevLineNum) - 4
endif
return indent(prevLineNum-1) - 4
Copy link
Contributor Author

@yohannd1 yohannd1 Jun 13, 2021
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way - I haven't modified this specific line (l. 56) but I'm curious: wouldn't it be better if it were indent(prevLineNum)? As far as I understood it gets the indentation inside the previous block and deindents it by one level, which I believe should result in the same as indent(PrevLineNum).

Copy link
Contributor

haze commented Jul 24, 2021
edited
Loading

(削除) Hey @YohananDiamond, I may have encountered a similar issue: (削除ここまで)

before I hit enter

after I hit enter

With the changes in this PR I was not able to see a change D:

EDIT: I figured out that this was my tree sitter plugin messing with the indentation! sorry for the false alarm...

yohannd1 and matu3ba reacted with thumbs up emoji

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /