Skip to content

Add Ribbon View, Demo Fold Provider, Ribbon Toggles #315

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

Open
wants to merge 8 commits into
base: feat/code-folding
Choose a base branch
from

Conversation

thecoolwinter
Copy link
Collaborator

@thecoolwinter thecoolwinter commented May 8, 2025

Description

Note

For reviewers, this is merging into the dev branch. These changes require the version of CETV in this PR. Please pull those changes locally and test using that.

Note

I'll be making some TODOs in the tracking issue #43 for things that aren't included here. Like the overlapping folds UI issue.

Adds the first version of the code folding ribbon, with a very basic folding model.

This is mostly a UI change. It includes changes to the gutter, and a new view for displaying folds. The model and related demo fold provider should be considered incomplete and only for demo purposes.

This also doesn't implement the hover state yet. Just a very basic outline of everything.

Things to review:

  • New FoldingRibbonView
  • New LineFoldingModel
  • Changes in GutterView
  • Changes to TextViewController
  • Changes to CodeEditSourceEditor

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Light mode.
Screenshot 2025-05-07 at 3 22 17 PM

Dark Mode.
Screenshot 2025-05-08 at 10 12 45 AM

Folds are transparent for scrolling text.
Screenshot 2025-05-08 at 10 08 35 AM

austincondiff and others added 2 commits May 9, 2025 11:25
### Description

This PR adds the following functionality to the source editor find
panel:
- Replace: Enables replacing matched text with the specified
replacement.
- Toggle Match Navigation Wrap-Around: Allows cycling through matches
from the beginning when reaching the end.
- Toggle Match Case: Adds an option to filter matches by case
sensitivity.
- Made find panel responsive at small sizes using `ViewThatFits`.

### Related Issues

* CodeEditApp#295
* CodeEditApp/CodeEditTextView#1

### Checklist

<!--- Add things that are not yet implemented above -->

- [x] I read and understood the [contributing
guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md)
as well as the [code of
conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code

### Screenshots


https://github.com/user-attachments/assets/ec23ffe7-6d24-48b7-889a-11a92ec6c147


https://github.com/user-attachments/assets/cfca6d8e-7b97-4258-ae2e-ee82bbf6b9af

---------

Co-authored-by: Khan Winter <35942988+thecoolwinter@users.noreply.github.com>
Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Left a few comments for your consideration but they shouldn't get in the way of a merge. Nice work!

@@ -16,8 +16,9 @@ let package = Package(
dependencies: [
// A fast, efficient, text view for code.
.package(
url: "https://github.com/CodeEditApp/CodeEditTextView.git",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to merge this dev code in the dev branch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, no that's not intentional.

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

Successfully merging this pull request may close these issues.

2 participants