Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
s/Peak/Peek

Mistakes will be made when coding near midnight
  • Loading branch information
noelwelsh committed Feb 7, 2025
1 parent 5cf5c87 commit 1d96131
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
5 changes: 3 additions & 2 deletions core/jvm/src/main/scala/terminus/JLineTerminal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.jline.terminal.TerminalBuilder
import org.jline.utils.InfoCmp.Capability
import terminus.effect.Eof
import terminus.effect.Timeout

import scala.concurrent.duration.Duration

class JLineTerminal(terminal: JTerminal) extends Terminal {
Expand All @@ -29,8 +30,8 @@ class JLineTerminal(terminal: JTerminal) extends Terminal {

def peek(duration: Duration): Timeout | Eof | Char =
reader.peek(duration.toMillis) match {
case -2 => Timeout
case -1 => Eof
case -2 => Timeout
case -1 => Eof
case char => char.toChar
}

Expand Down
5 changes: 3 additions & 2 deletions core/jvm/src/main/scala/terminus/Terminal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

package terminus

trait Terminal extends effect.AlternateScreenMode[Terminal],
trait Terminal
extends effect.AlternateScreenMode[Terminal],
effect.ApplicationMode[Terminal],
effect.Color[Terminal],
effect.Cursor,
effect.Display[Terminal],
effect.Erase,
effect.Peaker,
effect.Peeker,
effect.RawMode[Terminal],
effect.Reader,
effect.Writer
Expand Down
10 changes: 0 additions & 10 deletions core/shared/src/main/scala/terminus/Peaker.scala

This file was deleted.

27 changes: 27 additions & 0 deletions core/shared/src/main/scala/terminus/Peeker.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2024 Creative Scala
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package terminus

import terminus.effect.Eof
import terminus.effect.Timeout

import scala.concurrent.duration.Duration

trait Peeker {
def peek(duration: Duration): effect.Peeker ?=> Timeout | Eof | Char =
effect ?=> effect.peek(duration)
}
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/terminus/effect/Peeker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ import scala.concurrent.duration.Duration
sealed trait Timeout
object Timeout extends Timeout

trait Peaker extends Effect {
trait Peeker extends Effect {
def peek(duration: Duration): Timeout | Eof | Char
}

0 comments on commit 1d96131

Please sign in to comment.