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

Custom Text View #211

Merged
merged 79 commits into from
Dec 9, 2023
Merged

Custom Text View #211

merged 79 commits into from
Dec 9, 2023

Conversation

thecoolwinter
Copy link
Collaborator

@thecoolwinter thecoolwinter commented Sep 3, 2023

Description

Replaces STTextView with a custom TextView implementation. Creates a new TextView and TextViewController classes that manage rendering text, handling text input, and keybinds. TextViewController replaces the STTextViewController class, connecting existing TextFormation classes, syntax highlighting, and other existing text view extensions.

Related Issues

Checklist

TextView TODOs:

  • load text
  • render text
  • scroll
  • wrap text
  • resize
  • syntax highlighting
  • cursor
  • edit text
    • isEditable
    • Insert
    • Delete
      • Delete line
      • Delete word
      • Delete character
      • Delete across lines
    • Paste
    • Marked Text
  • Line Numbers
  • Select text
    • Copy
  • Multiple cursors
  • Keyboard navigation
    • Arrow keys
    • Command & control arrow keys
    • Page up and down
  • Tab widths & indents
  • Live parameter updating
  • Undo/redo
  • Sync system appearance
  • Highlight brackets
  • TextFormation integration
  • MacOS Sonoma cursor Leaving for future PR. Will require rework of cursor view system.
  • Update text from SwiftUI Binding (two-way binding)
  • Accessibility
  • Drag and Drop (bad, will need a rework but okay for now)

--

  • 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

// TODO

@thecoolwinter
Copy link
Collaborator Author

@matthijseikelenboom I tend to add internal for myself for extra verbosity when designing an API. I've removed them since they're unnecessary.

@thecoolwinter thecoolwinter requested a review from a team November 18, 2023 15:14
@thecoolwinter
Copy link
Collaborator Author

This is finally ready for some review!

Copy link
Contributor

@matthijseikelenboom matthijseikelenboom left a comment

Choose a reason for hiding this comment

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

Only comment I would have is that it'd be nice to have more tests, but that's all

@austincondiff austincondiff requested review from 0xWDG and a team December 6, 2023 07:19
0xWDG
0xWDG previously requested changes Dec 7, 2023
Copy link
Collaborator

@0xWDG 0xWDG 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, great work!

I have 2 notes.

  1. see requested change, this header filename isn't right.

  2. there is no consistency in the header docs
    In some files CodeEditTextView is in the header docs, in others it isn't, this is not breaking but looks a bit weird to me.

 //
 //  FILENAME.swift
 //  
 //
 //  Created by Khan Winter on 11/14/23.
 //

And in others

 //
 //  FILENAME.swift
 //  CodeEditTextView
 //
 //  Created by Khan Winter on 11/14/23.
 //

Co-authored-by: Wesley de Groot <email@wesleydegroot.nl>
@austincondiff austincondiff merged commit 40d8e88 into main Dec 9, 2023
2 checks passed
@austincondiff austincondiff deleted the feat/inputview branch December 9, 2023 17:09
thecoolwinter added a commit that referenced this pull request Dec 13, 2023
<!--- IMPORTANT: If this PR addresses multiple unrelated issues, it will
be closed until separated. -->

### Description

- Changes the package name to CodeEditSourceEditor.
- Uses the new CodeEditTextView repository instead of containing two
targets for the source editor and text view.
- Updates all repo names, fixes all headers (thanks @0xWDG for pointing
that out in #211).
- Marks the `CodeEditTextView` struct as deprecated in favor of
`CodeEditSourceEditor`.
- Fixes a small bug with cursor position that left out column info.

### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants