Skip to content
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

Small issue with source code indentation #138

Open
vbramselaar opened this issue Feb 21, 2025 · 6 comments
Open

Small issue with source code indentation #138

vbramselaar opened this issue Feb 21, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@vbramselaar
Copy link

vbramselaar commented Feb 21, 2025

Hi,

I like the app a lot, but there is a small issue with the indentation I think.

In Orgro:
Image

In simple text editor:
Image

It looks like the first indent is not done? I mean the lines below some (define ...)

@amake
Copy link
Owner

amake commented Feb 21, 2025

I'm not clear on what you are expecting. Do you want Orgro to look like the "simple text editor" screenshot?

I note that the "simple text editor" screenshot is using a proportional font, while the Orgro screenshot uses a monospace font. That alone could easily account for the difference in spacing.

@vbramselaar
Copy link
Author

I'm sorry, it is hard for me to explain. Below I copied the text so I can show it in monospace.

* 1.1.7
  #+begin_src scheme :session ch1
(define (square x) (* x x))

(define (average x y) (/ (+ x y) 2))

(define (good-enough? guess x)
  (< (abs (- (square guess) x)) 0.001))

(define (improve guess x)
  (average guess (/ x guess)))

(define (sqrt-iter guess x)
  (if (good-enough? guess x)
      guess
      (sqrt-iter (improve guess x)
                 x)))

(define (sqrt x) (sqrt-iter 1.0 x))

(sqrt 9)
  #+end_src

  #+RESULTS:
  : 3.00009155413138

It is not about the type of font. I mean that for example:

(define (good-enough? guess x)
  (< (abs (- (square guess) x)) 0.001))

Becomes this in Orgro:

(define (good-enough? guess x)
(< (abs (- (square guess) x)) 0.001))

It looks like.

@amake
Copy link
Owner

amake commented Feb 21, 2025

I see, thanks for clarifying.

Orgro currently doesn't nicely handle block content with less indent than the block delimiters. I'll see if I can fix it.

@amake amake added the bug Something isn't working label Feb 21, 2025
@amake
Copy link
Owner

amake commented Feb 22, 2025

This will be fixed in v1.54.3, ready for testing soon:

@amake
Copy link
Owner

amake commented Feb 22, 2025

I should note that Orgro still won't allow "negative" indents, meaning the content of the block will be at least as indented as the block delimiters. But the indents within the content should be preserved correctly.

@vbramselaar
Copy link
Author

Thats totally fine I think. Thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants