Skip to content

Commit

Permalink
reset spaces after for remaining chords in line
Browse files Browse the repository at this point in the history
  • Loading branch information
no-chris committed Aug 29, 2021
1 parent ea9986c commit 524b889
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/renderer/spacers/chord/chordLyrics.js
Expand Up @@ -63,8 +63,10 @@ export default function space(chordLineInput, lyricsLineInput) {
lyricToken += symbols.lyricsSpacer.repeat(lyricsSpaceAfter);
}
spacedLyricsLine += lyricToken;
chord.spacesWithin = 0;
} else {
chord.spacesAfter = chordSpaceAfterDefault;
}
chord.spacesWithin = 0;
}
);

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/renderer/spacers/chord/chordLyrics.spec.js
Expand Up @@ -65,10 +65,10 @@ describe.each([
'Put me on top',
],
[
'Spacing of extra chords should be kept (2 by default)',
'Spacing of extra chords should be reset to 1 (default spacing for chordLyricsSpacer)',
'A7 B C7 B7 F7',
'_Put me _on top',
'|A7 |B |C7 |B7 |F7 |',
'|A7 |B |C7 |B7 |F7 |',
'Put me on top',
],
[
Expand All @@ -82,7 +82,7 @@ describe.each([
'Edge case: no lyrics, single character chord!',
'A B C D',
'_ _ _ _',
'|A |B |C |D |',
'|A |B |C |D |',
'',
],
[
Expand Down

0 comments on commit 524b889

Please sign in to comment.