Skip to content

Commit

Permalink
Replace ⇒ and → with their ASCII variant
Browse files Browse the repository at this point in the history
  • Loading branch information
kiritsuku committed Oct 1, 2014
1 parent 616fca9 commit f18fc8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.junit.Ignore
class TextSelectionTest {

final implicit class OhILikeThisDslSoMuch(input: String) {
def becomes(expectedOutput: String) = input expectedOutput
def becomes(expectedOutput: String) = input -> expectedOutput
}
final implicit class IWannaHaveMoreOfIt(testData: (String, String)) {
def after(changes: Seq[String]) = test(testData._1, testData._2, changes)
Expand Down Expand Up @@ -86,7 +86,7 @@ class TextSelectionTest {
require(braces.size == changes.size, "The number of changes need to be equal to the number of the regions.")
val edit = new MultiTextEdit
changes zip braces foreach {
case (change, (start, end))
case (change, (start, end)) =>
edit.addChild(new ReplaceEdit(start, end-start, change))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ object EditorUtils {

def adjustOffset(overlapToPreserve: Int) = {
val lenAfterSelection = edit.getChildren().collect {
case e if e.start > selStart
case e if e.start > selStart =>
e match {
case e: ReplaceEdit e.length-e.getText().length
case e e.length
case e: ReplaceEdit => e.length-e.getText().length
case e => e.length
}
}.sum

Expand All @@ -277,8 +277,8 @@ object EditorUtils {
// case 3: ^ [ ] ^
else if (selStart < rStart && selEnd > rEnd) {
val sub = overlappingEdit match {
case e: ReplaceEdit e.length-e.getText().length
case e e.length
case e: ReplaceEdit => e.length-e.getText().length
case e => e.length
}
(adjustOffset(0), selLen-sub)
}
Expand All @@ -296,7 +296,7 @@ object EditorUtils {
new TextSelection(document, newOffset, newLen)
}

val overlappingEdit = edit.getChildren().find(e selectionOverlapsRegion(e.getRegion()))
val overlappingEdit = edit.getChildren().find(e => selectionOverlapsRegion(e.getRegion()))
overlappingEdit map handleOverlap getOrElse handleNonOverlap
}

Expand Down

0 comments on commit f18fc8d

Please sign in to comment.