Skip to content

Commit

Permalink
! Removed space between CJK characters in the Join Selected Lines com…
Browse files Browse the repository at this point in the history
…mand
  • Loading branch information
wmjordan committed Mar 27, 2021
1 parent cfc62bd commit dd07833
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Codist/Helpers/TextEditorHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public static void JoinSelectedLines(this ITextView view) {
else {
sb.Append(t, p, i - p);
}
if (i > 0 && "(['\"".IndexOf(t[i - 1]) == -1 && j < t.Length && ")]'\"".IndexOf(t[j]) == -1) {
if (i > 0 && NeedSpace("(['\"", t[i - 1]) && j < t.Length && NeedSpace(")]'\"", t[j])) {
sb.Append(' ');
}
i = j;
Expand All @@ -550,6 +550,10 @@ public static void JoinSelectedLines(this ITextView view) {
view.TextBuffer.Replace(span, sb.ToString());
b.Dispose();
}

bool NeedSpace(string tokens, char c) {
return tokens.IndexOf(c) == -1 && c < 0x2E80;
}
}
#endregion

Expand Down

0 comments on commit dd07833

Please sign in to comment.