Skip to content

Make cursor appear when clicking after the last line of a file (#56) #145

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 3 commits into from
Feb 20, 2023

Conversation

RenanGreca
Copy link
Contributor

@RenanGreca RenanGreca commented Feb 17, 2023

Description

  • In STTextViewController.swift, I created a subclass of NSScrollView to implement a custom mouseDown(with event:) function. The function makes it so, if a click is detected within the ScrollView but out of the contained STTextView, the editor cursor is placed on the last index of the text.

I created the subclass at the end of STTextViewController.swift, but it should probably go to its own file; upon review I would like suggestions of where to place this file, as none of the current directories seem appropriate for it.

Additionally, the name of the class is CEScrollView (CE for CodeEdit); I am not sure if there is a different naming convention customized subclasses.

Related Issue

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • I documented my code
  • Review requested

Screenshots

@thecoolwinter
Copy link
Collaborator

Looks awesome, I just left a comment about where to put the file like you asked. And one small change for finding the end range. Thank you! This has been needed for a while. Also yes the CE prefix is perfectly fine.

Copy link
Collaborator

@thecoolwinter thecoolwinter 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!

@thecoolwinter thecoolwinter merged commit e7a082a into CodeEditApp:main Feb 20, 2023
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.

🐞 Clicking empty area where there are no new lines does not clear text selection 🐞 Set a minimum height on the textview
3 participants