Make trailing :
into a setting (#6711)
* Make trailing `:` into a setting Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Make traling comma opt-out Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Write `insertTrailingComma` when reading for future opt-in setting Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Update src/editor/parts.ts * Fix line length Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> Co-authored-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
afbe3d16b4
commit
4c05b7da1f
5 changed files with 25 additions and 1 deletions
|
@ -30,6 +30,7 @@ import { unicodeToShortcode } from "../HtmlUtils";
|
|||
import * as Avatar from "../Avatar";
|
||||
import defaultDispatcher from "../dispatcher/dispatcher";
|
||||
import { Action } from "../dispatcher/actions";
|
||||
import SettingsStore from "../settings/SettingsStore";
|
||||
|
||||
interface ISerializedPart {
|
||||
type: Type.Plain | Type.Newline | Type.Emoji | Type.Command | Type.PillCandidate;
|
||||
|
@ -650,7 +651,10 @@ export class PartCreator {
|
|||
userId: string,
|
||||
): [UserPillPart, PlainPart] {
|
||||
const pill = this.userPill(displayName, userId);
|
||||
const postfix = this.plain(insertTrailingCharacter ? ": " : " ");
|
||||
const postfix = this.plain(
|
||||
insertTrailingCharacter &&
|
||||
(SettingsStore.getValue("MessageComposerInput.insertTrailingComma") ? ": " : " "),
|
||||
);
|
||||
return [pill, postfix];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue