-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enabling terminal dimension feature #16
base: main
Are you sure you want to change the base?
Conversation
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.
I think this would benefit from a few tweaks. Also, if you run the build
command from sbt that will add copyright headers, do formatting, etc. This is necessary for CI to pass the code.
|
||
/** Functionality for getting the dimensions of the terminal */ | ||
trait Dimensions extends Writer { | ||
def getDimensions: Unit |
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.
I think we want this method to return the dimensions, so something like
def getDimensions(): (Int, Int)
or
def getSize(): Size
where Size
is something like
final case class Size(x: int, y: Int)
(or perhaps rows and columns instead of x and y; see what the convention is in the commands that move the cursor around.)
I've used the convention that side effecting methods have empty parameter lists. I.e. def getSize()
, not def getSize
/** Functionality for getting the dimensions of the terminal */ | ||
trait Dimensions { | ||
object dimensions { | ||
def getDimensions: effect.Dimensions ?=> Unit = effect ?=> |
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.
If this is wrapped in an object named dimensions
, we don't need to name the method getDimensions
. Just get
is fine.
Alternatively it could just be getDimensions
without the wrapping object. This is not a method that is going to have a name collision, unlike the methods for setting color and moving the cursor.
@@ -47,6 +46,15 @@ class JLineTerminal(terminal: JTerminal) extends Terminal { | |||
} | |||
} | |||
|
|||
// Do we need to consider getBufferSize? |
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.
I have no idea what most of these methods do. The JLine documentation is, unfortunately, not very good.
0c1509a
to
263ac4c
Compare
No description provided.