mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-28 00:56:51 +03:00
Tiny clean up/refactor in the applyReplace function
This commit is contained in:
parent
c5d706f739
commit
7f6580d1fd
@ -148,22 +148,16 @@ applyReplace range replacement lines =
|
|||||||
startLine : String
|
startLine : String
|
||||||
startLine =
|
startLine =
|
||||||
getRowAtLine lines (range.start.row - 1)
|
getRowAtLine lines (range.start.row - 1)
|
||||||
|
|> String.slice 0 (range.start.column - 1)
|
||||||
startLineBefore : String
|
|
||||||
startLineBefore =
|
|
||||||
String.slice 0 (range.start.column - 1) startLine
|
|
||||||
|
|
||||||
endLine : String
|
endLine : String
|
||||||
endLine =
|
endLine =
|
||||||
getRowAtLine lines (range.end.row - 1)
|
getRowAtLine lines (range.end.row - 1)
|
||||||
|
|> String.dropLeft (range.end.column - 1)
|
||||||
endLineAfter : String
|
|
||||||
endLineAfter =
|
|
||||||
String.dropLeft (range.end.column - 1) endLine
|
|
||||||
in
|
in
|
||||||
List.concat
|
List.concat
|
||||||
[ linesBefore
|
[ linesBefore
|
||||||
, startLineBefore ++ replacement ++ endLineAfter |> String.lines
|
, startLine ++ replacement ++ endLine |> String.lines
|
||||||
, linesAfter
|
, linesAfter
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user