CodeEditApp / CodeEditSourceEditor

A code editor view written in Swift powered by tree-sitter.
https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor
MIT License
510 stars 78 forks source link

Editor Overscroll #100

Closed yusufozgul closed 1 year ago

yusufozgul commented 1 year ago

Related Issue:

lukepistrol commented 1 year ago

Great work!

One suggestion though:

yusufozgul commented 1 year ago

Thank you for review :)

Yes, you are right, I made changes, also I realized a bug while changing the content inset, I should have changed contentView's bottom inset not scrollView. Otherwise after updating once, the UI does not change

austincondiff commented 1 year ago

This is my fault for not adding a description to the issue but I'd like to discuss how this works. I see now what @lukepistrol is suggesting. The first question is, does it make sense to allow that much flexibility?

As an example, Nova only has Small, Medium, and Large

image

VS Code only has a checkbox

image

My second question is, how are we displaying this in our Settings panel?

yusufozgul commented 1 year ago

@austincondiff I actually thought Xcode like (none, small, medium, large). And even Nova the same. For ide, values will be just constant percentage. Xcode percentages: 0.25, 0.5, 0.75

austincondiff commented 1 year ago

@yusufozgul I am for this approach so we can be consistent with Xcode.

@lukepistrol does this work for you?

lukepistrol commented 1 year ago

@austincondiff I would either go with the way Xcode handles it (none, small, medium, large) or a slider with detents (0% - 100% in 10% steps).

A fixed number of lines becomes problematic when the window height becomes smaller than said amount. And a on-off toggle is not enough flexibility.

austincondiff commented 1 year ago

Ok, then let's go with the Xcode approach. We should rename the variable though. Here are a few options

Doesn't "amount" imply a number? Will this now be set to an enum - .none, .small, .medium, .large?

In SwiftUI for example they keep it simple. .opacity(0.5) is not opacityAmount or opactyPercentage.

Sorry to get hung up on a small detail. As they say...

"There are only two hard things in Computer Science: cache invalidation and naming things"

matthijseikelenboom commented 1 year ago

Doesn't "amount" imply a number?

Yeah I agree. editorOverscrollSetting or editorOverscrollConfig comes to mind for me. But perhaps editorOverscroll is also fine.

austincondiff commented 1 year ago

I mean, "Editor Overscroll" is what the label says, so editorOverscroll makes sense to me

yusufozgul commented 1 year ago

It seems editorOverscroll nice for everyone