mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-23 23:05:35 +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 =
|
||||
getRowAtLine lines (range.start.row - 1)
|
||||
|
||||
startLineBefore : String
|
||||
startLineBefore =
|
||||
String.slice 0 (range.start.column - 1) startLine
|
||||
|> String.slice 0 (range.start.column - 1)
|
||||
|
||||
endLine : String
|
||||
endLine =
|
||||
getRowAtLine lines (range.end.row - 1)
|
||||
|
||||
endLineAfter : String
|
||||
endLineAfter =
|
||||
String.dropLeft (range.end.column - 1) endLine
|
||||
|> String.dropLeft (range.end.column - 1)
|
||||
in
|
||||
List.concat
|
||||
[ linesBefore
|
||||
, startLineBefore ++ replacement ++ endLineAfter |> String.lines
|
||||
, startLine ++ replacement ++ endLine |> String.lines
|
||||
, linesAfter
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user