-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Push newly created file into the workspace (#696) #1057
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 tasks
thecoolwinter
previously requested changes
Feb 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one change about the DispatchQueue
usage.
CodeEdit/Features/NavigatorSidebar/NavigatorSidebarToolbarBottom.swift
Outdated
Show resolved
Hide resolved
thecoolwinter
pushed a commit
to CodeEditApp/CodeEditSourceEditor
that referenced
this pull request
Feb 17, 2023
…#696) (#144) # Description <!--- REQUIRED: Describe what changed in detail --> * In `STTextViewController.swift`, the `setCursorPosition` function was changed so that, if the currently open file is empty, the cursor is automatically set to the first position and active. This behavior is similar to other text editors e.g. VSCode. A related PR is opened in CodeEdit, which works in tandem with this one, so that newly-created files automatically open in a new editor tab. # Related Issue <!--- REQUIRED: Tag all related issues (e.g. * #23) --> * [#696](CodeEditApp/CodeEdit#696) from CodeEdit. * PR [#1057](CodeEditApp/CodeEdit#1057) from CodeEdit. # 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] My changes generate no new warnings - [x] My code builds and runs on my machine - [x] I documented my code - [x] Review requested # Screenshots
matthijseikelenboom
approved these changes
Feb 20, 2023
0xWDG
approved these changes
Feb 20, 2023
@allcontributors add @RenanGreca for code |
I've put up a pull request to add @RenanGreca! 🎉 |
@jpinnix Thanks for pointing this out. Both of them are now closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
FileItem.swift
, theaddFile
function was changed to return the newly created file's path.NavigationSidebarToolbarBottom.swift
, a bit of post-creation code was introduced, placed in the global DispatchQueue, which attempts to open the new file in a new tab in the workspace.A related PR is being opened in CodeEditTextView, which works in tandem with this one, so the cursor becomes active in the new file after it is created and opened.
Particularly, I would like a review on the code added to
NavigationSidebarToolbarBottom.swift
, as I'm not 100% sure the DispatchQueue behavior is consistent in this case. Certainly without putting it on the queue, the behavior was completely non-deterministic, because the code would sometimes run before the completion ofrebuildFiles
inLive.swift
(and thus the new FileItem was not yet available).Related Issue
Checklist
Screenshots