diff --git a/fcore/normal-mode/normal-mode.sml b/fcore/normal-mode/normal-mode.sml index 8d73569..cf74d00 100644 --- a/fcore/normal-mode/normal-mode.sml +++ b/fcore/normal-mode/normal-mode.sml @@ -5,9 +5,9 @@ struct open AppType open InputMsg - fun switchToNormalSearchMode (app: app_type) = + fun switchToNormalSearchMode (app: app_type, caseSensitive) = NormalSearchFinish.onSearchChanged - (app, "", PersistentVector.empty, 0, 0, false, #buffer app) + (app, "", PersistentVector.empty, 0, 0, caseSensitive, #buffer app) fun getNumLength (pos, str) = if pos = String.size str then @@ -196,7 +196,8 @@ struct | #"%" => NormalMove.moveToMatchingPair app | #"x" => NormalDelete.removeChr (app, count, time) | #"J" => NormalDelete.removeLineBreaks (app, count, time) - | #"/" => switchToNormalSearchMode app + | #"/" => switchToNormalSearchMode (app, false) + | #"?" => switchToNormalSearchMode (app, true) | #">" => indnetLine (app, count, time) | #"<" => dedentLine (app, count, time) (* multi-char commands which can be appended *) diff --git a/fcore/text-builder/search-bar.sml b/fcore/text-builder/search-bar.sml index c1a475b..46e426f 100644 --- a/fcore/text-builder/search-bar.sml +++ b/fcore/text-builder/search-bar.sml @@ -82,8 +82,8 @@ struct val fPosX = Real32.fromInt startX val fPosY = Real32.fromInt startY - val slash = CozetteAscii.make - ( #"/" + val searchSymbol = CozetteAscii.make + ( if caseSensitive then #"?" else #"/" , fPosX , fPosY , z @@ -102,31 +102,17 @@ struct val xpos = Int.min (endX, xpos) val x = Real32.fromInt xpos in - if caseSensitive then - CozetteAscii.make - ( #"?" - , x - , fPosY - , 0.01 - , TC.scale - , floatWindowWidth - , floatWindowWidth - , r - , g - , b - ) - else - PipeCursor.lerp - ( x - , fPosY - , 0.01 - , TC.scale - , floatWindowWidth - , floatWindowHeight - , r - , g - , b - ) + PipeCursor.lerp + ( x + , fPosY + , 0.01 + , TC.scale + , floatWindowWidth + , floatWindowHeight + , r + , g + , b + ) end val posX = startX + TC.xSpace @@ -137,7 +123,7 @@ struct , posX , startY , endX - , [cursor, slash] + , [cursor, searchSymbol] , floatWindowWidth , floatWindowHeight )