Skip to content

Commit

Permalink
Remove some double spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Sep 17, 2024
1 parent e68001b commit a98af3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -1258,9 +1258,9 @@ static bool print_term_to_buf_(query *q, cell *c, pl_idx c_ctx, int running, int

if (quote) { SB_sprintf(q->sb, "%s", quote?"'":""); }
SB_strcatn(q->sb, src, srclen);
if (quote) { SB_sprintf(q->sb, "%s", quote?"' ":""); }

if (!iswalpha(peek_char_utf8(src)))
if (quote)
{ SB_sprintf(q->sb, "%s", quote?"' ":""); q->last_thing = WAS_SPACE; }
else if (!iswalpha(peek_char_utf8(src)))
q->last_thing = WAS_SYMBOL;
else
q->last_thing = WAS_OTHER;
Expand All @@ -1275,7 +1275,7 @@ static bool print_term_to_buf_(query *q, cell *c, pl_idx c_ctx, int running, int
return true;
}

if (space || parens) {
if ((q->last_thing != WAS_SPACE) && (space || parens)) {
SB_sprintf(q->sb, "%s", " ");
q->last_thing = WAS_SPACE;
}
Expand Down

0 comments on commit a98af3c

Please sign in to comment.