Skip to content

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

3 participants