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

🐞 Text scrolls underneath ruler #195

Closed
wjk opened this issue Jun 11, 2023 · 4 comments · Fixed by #211
Closed

🐞 Text scrolls underneath ruler #195

wjk opened this issue Jun 11, 2023 · 4 comments · Fixed by #211
Labels
bug Something isn't working

Comments

@wjk
Copy link

wjk commented Jun 11, 2023

Description

Apparently, CodeEditTextView does not fully take into account the size of the left-hand ruler when positioning its content. As a result, when I open a file in CodeEdit, the left-hand side of each line is cut off because it is being drawn underneath the ruler. I can scroll to the right to pull the content out from underneath the ruler, but this cuts off the part of the line at the right side of the screen. This is terribly annoying and makes line-wrap not work properly.

To Reproduce

  1. Open a file in CodeEdit
  2. Observe the cut off text and horizontal scrollbar

Expected Behavior

The text in the text view should appear to the right of the ruler, not under it. There should be no horizontal scrollbar.

Version Information

CodeEdit: 0.0.3-alpha (32)
macOS: 13.4 (22F66)
Xcode: 15.0 (15A5160n)

Additional Context

Previously reported as CodeEditApp/CodeEdit#1306.

Screenshots

Screenshot 2023-06-09 at 9 01 14 PM Screenshot 2023-06-09 at 9 01 00 PM
@wjk wjk added the bug Something isn't working label Jun 11, 2023
@luah5
Copy link
Member

luah5 commented Jun 12, 2023

I'm pretty sure this was fixed in #177, are you running CodeEdit from Xcode or from the latest app release on github?

@wjk
Copy link
Author

wjk commented Jun 12, 2023

Latest release on GitHub. I tried to build from source first, but Xcode kept choking on the 70MB xcframework in CodeEditLanguages. It generally just quit downloading entirely, and I know of no good way to get it to resume without deleting the clones and starting over — at which point Xcode usually chokes again. If you have any ideas as to how I could address this, I’m all ears.

@wjk
Copy link
Author

wjk commented Jun 12, 2023

Strike that regarding the download errors. I have just got it to work.

@thecoolwinter
Copy link
Collaborator

This should be fixed with #211. The gutter has been reimplemented to be a floating view instead of a ruler view and the text view updated to account for that automatically.

@thecoolwinter thecoolwinter mentioned this issue Nov 18, 2023
41 tasks
austincondiff added a commit that referenced this issue Dec 9, 2023
<!--- IMPORTANT: If this PR addresses multiple unrelated issues, it will
be closed until separated. -->

### 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

* closes #208 
* closes #195 
* closes #184 
* closes #57 

### Checklist

TextView TODOs:
- [X] load text
- [X] render text
- [X] scroll
- [X] wrap text
- [X] resize
- [x] syntax highlighting
- [x] cursor
- [x] edit text
    - [x] isEditable
    - [x] Insert
    - [x] Delete
        - [x] Delete line
        - [x] Delete word
        - [x] Delete character
        - [x] Delete across lines
    - [x] Paste
- [x] [Marked
Text](https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextEditing/TextEditing.html#//apple_ref/doc/uid/TP40009459-CH3-SW26)
- [x] Line Numbers
- [x] Select text
    - [x] Copy
- [x] Multiple cursors
- [x] Keyboard navigation
    - [x] Arrow keys
    - [x] Command & control arrow keys
    - [ ] Page up and down
- [x] Tab widths & indents
- [x] Live parameter updating
- [x] Undo/redo
- [x] Sync system appearance
- [x] Highlight brackets
- [x] TextFormation integration
- [ ] ~MacOS Sonoma cursor~ Leaving for future PR. Will require rework
of cursor view system.
- [x] Update text from SwiftUI Binding (two-way binding)
- [x] Accessibility
- [x] Drag and Drop (bad, will need a rework but okay for now)

--
- [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

`// TODO`

---------

Co-authored-by: Austin Condiff <austin.condiff@gmail.com>
Co-authored-by: Wesley de Groot <email@wesleydegroot.nl>
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
Status: 🏁 Complete
Development

Successfully merging a pull request may close this issue.

3 participants