}
[WinFormsFact]
+ public void FormatStatusText_SeparateUrlAndFullwidthCharacter_EnabledTest()
+ {
+ this.UsingTweenMain((tweenMain, context) =>
+ {
+ tweenMain.SeparateUrlAndFullwidthCharacter = true;
+ Assert.Equal("https://example.com/ あああ", tweenMain.FormatStatusText("https://example.com/あああ"));
+ });
+ }
+
+ [WinFormsFact]
+ public void FormatStatusText_SeparateUrlAndFullwidthCharacter_DisabledTest()
+ {
+ this.UsingTweenMain((tweenMain, context) =>
+ {
+ tweenMain.SeparateUrlAndFullwidthCharacter = false;
+ Assert.Equal("https://example.com/あああ", tweenMain.FormatStatusText("https://example.com/あああ"));
+ });
+ }
+
+ [WinFormsFact]
public void FormatStatusText_ReplaceFullwidthSpace_EnabledTest()
{
this.UsingTweenMain((tweenMain, context) =>
private readonly DebounceTimer saveConfigDebouncer;
private readonly string recommendedStatusFooter;
- private bool urlMultibyteSplit = false;
+
+ internal bool SeparateUrlAndFullwidthCharacter { get; set; } = false;
+
private bool preventSmsCommand = true;
// URL短縮のUndo用
{
statusText = statusText.Replace("\r\n", "\n");
- if (this.urlMultibyteSplit)
+ if (this.SeparateUrlAndFullwidthCharacter)
{
// URLと全角文字の切り離し
statusText = Regex.Replace(statusText, @"https?:\/\/[-_.!~*'()a-zA-Z0-9;\/?:\@&=+\$,%#^]+", "$& ");
}
private void UrlMultibyteSplitMenuItem_CheckedChanged(object sender, EventArgs e)
- => this.urlMultibyteSplit = ((ToolStripMenuItem)sender).Checked;
+ => this.SeparateUrlAndFullwidthCharacter = ((ToolStripMenuItem)sender).Checked;
private void PreventSmsCommandMenuItem_CheckedChanged(object sender, EventArgs e)
=> this.preventSmsCommand = ((ToolStripMenuItem)sender).Checked;
private void PostModeMenuItem_DropDownOpening(object sender, EventArgs e)
{
- this.UrlMultibyteSplitMenuItem.Checked = this.urlMultibyteSplit;
+ this.UrlMultibyteSplitMenuItem.Checked = this.SeparateUrlAndFullwidthCharacter;
this.PreventSmsCommandMenuItem.Checked = this.preventSmsCommand;
this.UrlAutoShortenMenuItem.Checked = this.settings.Common.UrlConvertAuto;
this.IdeographicSpaceToSpaceMenuItem.Checked = this.settings.Common.WideSpaceConvert;
private void ContextMenuPostMode_Opening(object sender, CancelEventArgs e)
{
- this.UrlMultibyteSplitPullDownMenuItem.Checked = this.urlMultibyteSplit;
+ this.UrlMultibyteSplitPullDownMenuItem.Checked = this.SeparateUrlAndFullwidthCharacter;
this.PreventSmsCommandPullDownMenuItem.Checked = this.preventSmsCommand;
this.UrlAutoShortenPullDownMenuItem.Checked = this.settings.Common.UrlConvertAuto;
this.IdeographicSpaceToSpacePullDownMenuItem.Checked = this.settings.Common.WideSpaceConvert;