Tags: CodeEditApp/CodeEditTextView
Tags
Add `fill` Emphasis Style Option (#120) ### Description Adds an option to fill in the color emphasis style. ### Related Issues * N/A ### Checklist - [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 N/A
Layout Invalidation Performance (#118) ### Description Made the layout manager *move* lines that weren't invalidated instead of re-typesetting them. Also made the reuse queue just make views tiny and hide them instead of removing them from the view hierarchy, and queue more views. After these changes, layout in the source editor goes from taking up *36% of the CPU* time while editing, to taking up **5% of main thread CPU time**. - Added a new debug mode for visualizing line fragment invalidation. - Adjusted the layout pass to avoid typesetting lines that don't need layout. - Made a distinction between 'forced layout' via `setNeedsLayout` and 'continued' layout where a line previously scanned in the layout pass was updated. - Due to that, I was able to check if a line fragment actually needed typesetting or just potentially needed to have it's position adjusted. - Added a new method to update a line's view's positions during layout. - Removed the unnecessary `lineRange` variable on the `LineFragment` class. - Adjusted the use of `documentRange` on the `LineFragment` class. It's now updated during layout, simplifying various methods. ### Related Issues * N/A ### Checklist - [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 Before: https://github.com/user-attachments/assets/05027712-5690-4970-b1ab-e0b4fe9553ec After: https://github.com/user-attachments/assets/36350ea1-66d8-43d0-a676-1bb770a733d7
Skip Selection Update in Undo/Redo (#113) ### Description Skips updating the selection when performing undo/redo. ### Related Issues N/A ### Checklist - [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 N/A
Fix End of Doc Bugs (#112) ### Description Fixes a few end-of-document bugs: - `rectForOffset` had an incorrect `!=` instead of a `<` check for the end of the document. - `mouseDown` needed to be looser on finding content runs for the end of documents. Adds test cases that would have caught both these bugs. ### Related Issues N/A ### 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 N/A
Add Text Attachment Actions (#111) ### Description Adds actions to text attachments. Actions are performed in either of the following: - A selection's range exactly matches that of the attachment, and the enter key is pressed. - For multiple cursors, if any selections match, the action is taken on all matching selections and other behaviors are ignored. - An attachment is double-clicked. Attachments can return an action enum to indicate what the textview should do when the action is invoked. This allows for attachments to let the textview handle some common cases like discarding the attachment or replacing it with text, and allows attachments to perform their own logic at the same time. ### Related Issues * CodeEditApp/CodeEditSourceEditor#43 ### Checklist - [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 Example in CodeEdit's folding attachments. https://github.com/user-attachments/assets/1bd670b4-08ed-463e-8f06-8b2fff7e0cbb
Track Mouse Drag Outside View (#108) ### Description Fixes a bug that didn't allow the view to track drags outside it's bounds. Users can now drag selections over other views and outside the window. ### Related Issues * closes #100 * closes CodeEditApp/CodeEditSourceEditor#316 ### Checklist - [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/ffbad5bf-5a56-4ef8-91f7-c5a9bb725208
Draw Invisible Characters From Configuration (#103) ### Description Adds the ability for developers to pass in an object to determine invisible character drawing. This is intentionally not doing the character matching and replacement styling in this package. To achieve the flexibility we want, I've raised that to the level of the source editor which can for instance determine if we want to draw a dot with larger emphasis because it's on a tab stop. #### Detailed changes: - Moved all line fragment drawing to a new object `LineFragmentRenderer`. Line fragments were increasingly requiring more and more objects to be passed to them. This object centralizes those dependencies into one object. - Adds a new `InvisibleCharactersDelegate` protocol for API consumers to conform to. Consumers can provide a set of characters to match on, and a method to provide a 'style' to draw them with. - Makes a slight adjustment to how cursors and line fragment views are added to the view hierarchy. - Cursors are now placed at the top of the subview stack, ensuring they're always on top of the content. - Line fragments are now placed on the bottom of the subview stack, ensuring they're always drawn under cursors. ### Related Issues * #22 ### Checklist - [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 Fleshed out example with CESE replacing tabs with arrows, spaces with dots, emphasizing a zero-width space (), and replacing newlines with the (¬) character. 
[hotfix:] Layout After New/Removed Lines (#97) ### Description Hotfix to fix mistakenly broken editing capabilities for inserting or deleting new lines. Updates the layout pass to correctly detect new lines, and if a new one is laid out, continues to layout lines after that line. Eg: ``` 1 2 <- Insert "\n" 3 ``` Before: ``` [visible text] 1 2 <- Layout invalidated 3 <- Layout _NOT_ invalidated, missing new line. ``` Now: ``` [visible text] 1 2 <- Layout invalidated <- Layout invalidated 3 <- Layout invalidated ``` Adds a new test case for this. ### Related Issues ### Checklist - [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
Don't Try to Set a Negative Frame Height (#96) ### Description Fixes a potential recursion where CETV tries to set it's frame to a negative number (due to overscroll & scroll inset weirdness). This adds a super simple sanity check to make sure we limit the textview to a `0` frame at minimum. This hang would occur when no content is present, making the content size an odd number, which also makes scroll views freak out on macOS. ### Related Issues * CodeEditApp/CodeEdit#2049 ### Checklist - [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 N/A, fixes a hang.
PreviousNext