CodeEditApp / CodeEditSourceEditor

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

✨ Minimap #33

Open austincondiff opened 2 years ago

austincondiff commented 2 years ago

Overview

This view represents your code in a smaller form. The VSCode documentation says in best...

A Minimap (code outline) gives you a high-level overview of your source code, which is useful for quick navigation and code understanding. A file's minimap is shown on the right side of the editor. You can click or drag the shaded area to quickly jump to different sections of your file.

image

Tip: You can move the minimap to the left hand side or disable it completely by respectively setting "editor.minimap.side": "left" or "editor.minimap.enabled": false in your user or workspace settings.

Resources

nanashili commented 2 years ago

This is do able just not sure where to do it or where to add it in the codebase

Carlos-Mero commented 2 years ago

Actually I'd prefer the minimap like Xcode rather than VScode. The minimap of Xcode contains more useful features and looks cleaner and much more beautiful. It will definitely take more work to make one like that, but I believe you'll love it too.

tjkohli commented 1 year ago

@Yellow-GGG I agree the Xcode minimap is far more useful; however at the same time I think it may be wiser to ship a minimap with minimal functionality and then add complexity in future releases.

austincondiff commented 1 year ago

@tjkohli I completely agree. We need to get something in place first, then we can iterate and improve.

Eliulm commented 1 year ago

Hey @austincondiff, could you assign this to me? I already got some of the CodeEditorView code working:

Image

Eliulm commented 1 year ago

This is the current state of the minimap. Still a lot of bugs to fix, but I am getting there slowly...

https://user-images.githubusercontent.com/82230675/231145498-c3f3ad40-2a18-4034-9e3c-c883e0843a42.mov

@thecoolwinter I need to set the bounds of the visibleRange in STTextview+VisibleRange to the visibleBounds of the MinimapView conditionally. How should I rewrite the code, so that I can pass props to visibleTextRange variable?

austincondiff commented 1 year ago

Looks great! Where are we with this?

Eliulm commented 1 year ago

Unfortunately, I have had little time recently, since I am currently working on my degree.

I have decided that I am going re-implement the minimap in textkit2, instead of textkit1, since the resizing was very laggy. I have also encountered multiple issues like #184, which need to be resolved first, so that the minimap can work properly.