lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Indentation, was Re: A snippet for editing Beams using the mouse


From: David Wright
Subject: Indentation, was Re: A snippet for editing Beams using the mouse
Date: Mon, 16 Dec 2019 19:17:53 -0600
User-agent: Mutt/1.10.1 (2018-07-13)

On Mon 16 Dec 2019 at 23:55:52 (+0100), Paolo Prete wrote:
> P.S) I don't know why the browser's viewer messes up the indentation of
> these attachments.
> If so, I ask if are there volunteers to fix that and re-post the snippet (I
> see correct indentation if I paste the code to any online js editor)

I don't know how scheme is meant to be indented so, other than to say
that my emacs (LilyPond mode) indents by aligning parentheses of the
same nesting-level (which indents the 8th and 9th lines to >60 chars),
I'll move on to C.

It appears you're indenting with real TAB characters, possibly
generated by your pressing the TAB key. My tabs are set at the
standard size (8) which makes some of the code cross the screen.
Perhaps you are expecting something else?

Looking, for example, at the lines that you've split, editing your
TABS to two spaces brings the continuation line into sensible
alignment with the initial line. So, if you want your indentation to
be displayed correctly by other people (including your own browser?) I
would replace your real TABs with spaces before attaching the files.

Editing in emacs, the TAB key can be made to indent by two spaces,
and conversion of 8 (or any other number of) spaces into a TAB
prevented.

>       distanceFromCenter = Math.abs(event.pageX * scaleX - 
>                                                                               
>                                                 (leftX + (rightX - leftX)/2))

becomes

>   distanceFromCenter = Math.abs(event.pageX * scaleX - 
>                                 (leftX + (rightX - leftX)/2))

and

>       minDistance = Math.min(distanceFromLeftSide, 
>                                                                               
>                  distanceFromCenter, 
>                                                                               
>                  distanceFromRightSide)

becomes

>   minDistance = Math.min(distanceFromLeftSide, 
>                          distanceFromCenter, 
>                          distanceFromRightSide)

when TAB is replaced by two spaces.

Cheers,
David.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]