Skip to content

Commit

Permalink
Prevent adding a trailing space
Browse files Browse the repository at this point in the history
  • Loading branch information
aabounegm committed Dec 5, 2023
1 parent ca773d9 commit 1c4bc8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rzk/src/Rzk/Format.hs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ formatTextEdits contents = go initialState toks
edits = spaceEdits ++ unicodeEdits
spaceEdits
| tk `elem` ["->", "", ",", "*", "×", "="] = map snd $ filter fst
-- Ensure exactly one space before (unless first char in line)
[ (not isFirstNonSpaceChar && spacesBefore /= 1,
-- Ensure exactly one space before (unless first char in line, or about to move to next line)
[ (not isFirstNonSpaceChar && spacesBefore /= 1 && not isLastNonSpaceChar,
FormattingEdit line (col - spacesBefore) line col " ")
-- Ensure exactly one space after (unless last char in line)
, (not isLastNonSpaceChar && spacesAfter /= 1,
Expand Down

0 comments on commit 1c4bc8f

Please sign in to comment.