Skip to content

Commit 83f56a9

Browse files
committed
Fix pluralization on collapsed lines indicator
1 parent e6828b1 commit 83f56a9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/UnisonShare/DefinitionDiffCard.elm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Code.Syntax.SyntaxSegment as SyntaxSegment
66
import Html exposing (Html, code, div, header, pre, span, text)
77
import Html.Attributes exposing (class, style)
88
import List.Nonempty as NEL
9+
import String.Extra exposing (pluralize)
910
import UI.Tooltip as Tooltip
1011
import UnisonShare.DefinitionDiff as DefinitionDiff exposing (DefinitionDiff(..), DiffDetails, DiffLine(..), DiffSegment(..))
1112

@@ -116,8 +117,17 @@ viewCollapsed : (DiffLine -> Html msg) -> DefinitionDiff.Collapsed -> Html msg
116117
viewCollapsed viewLine collapsed =
117118
case collapsed of
118119
DefinitionDiff.Collapsed lines ->
120+
let
121+
numCollapsedLines =
122+
List.length lines
123+
in
119124
div [ class "collapsed-section" ]
120-
[ text ((lines |> List.length |> String.fromInt) ++ " lines hidden...") ]
125+
[ text
126+
(String.fromInt numCollapsedLines
127+
++ pluralize " line " " lines " numCollapsedLines
128+
++ "hidden..."
129+
)
130+
]
121131

122132
DefinitionDiff.NotCollapsed lines ->
123133
div [] (List.map viewLine lines)

0 commit comments

Comments
 (0)