Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

if then else on one line #91

Open
ondohotola opened this issue Sep 10, 2023 · 1 comment
Open

if then else on one line #91

ondohotola opened this issue Sep 10, 2023 · 1 comment

Comments

@ondohotola
Copy link

Hi, if I do something like

if row in (0, 1) {
      myred 
   } 
   else if calc.odd(row) { myblue } 
   else { none },

tysptfmt makes something like

if row in (0, 1) { myred } else if calc.odd(row) { myblue } else { none },

out of it, ie puts it into a single (long) line, which I find difficult to read

@astrale-sharp
Copy link
Owner

astrale-sharp commented Sep 11, 2023

EDITED: you were right, i forgot to add # when copying your snippet for testing

It should be like this or like this

if row in (0, 1) { myred } else if calc.odd(row) {
  myblue
} else { none },
if row in (0, 1) { myred } else if calc.odd(row) {
  myblue 
} else { 
  none 
},

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

No branches or pull requests

2 participants