whitespace forced changes (#6002)

This commit is contained in:
Clint Rutkas
2020-08-17 10:00:56 -07:00
committed by GitHub
parent 649e7e103d
commit d055ba1c3b
129 changed files with 14175 additions and 14175 deletions

View File

@@ -1,14 +1,14 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Microsoft.Plugin.Program.UnitTests")]
namespace Wox.Infrastructure
{
public class StringMatcher
@@ -61,11 +61,11 @@ namespace Wox.Infrastructure
/// </summary>
public MatchResult FuzzyMatch(string query, string stringToCompare, MatchOption opt)
{
if (string.IsNullOrEmpty(stringToCompare) || string.IsNullOrEmpty(query))
{
return new MatchResult(false, UserSettingSearchPrecision);
}
if (string.IsNullOrEmpty(stringToCompare) || string.IsNullOrEmpty(query))
{
return new MatchResult(false, UserSettingSearchPrecision);
}
query = query.Trim();
if (_alphabet != null)
@@ -76,8 +76,8 @@ namespace Wox.Infrastructure
var fullStringToCompareWithoutCase = opt.IgnoreCase ? stringToCompare.ToLower() : stringToCompare;
var queryWithoutCase = opt.IgnoreCase ? query.ToLower() : query;
var queryWithoutCase = opt.IgnoreCase ? query.ToLower() : query;
var querySubstrings = queryWithoutCase.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
int currentQuerySubstringIndex = 0;
var currentQuerySubstring = querySubstrings[currentQuerySubstringIndex];
@@ -151,18 +151,18 @@ namespace Wox.Infrastructure
currentQuerySubstringIndex++;
allQuerySubstringsMatched = AllQuerySubstringsMatched(currentQuerySubstringIndex, querySubstrings.Length);
if (allQuerySubstringsMatched)
{
break;
}
// otherwise move to the next query substring
if (allQuerySubstringsMatched)
{
break;
}
// otherwise move to the next query substring
currentQuerySubstring = querySubstrings[currentQuerySubstringIndex];
currentQuerySubstringCharacterIndex = 0;
}
}
// proceed to calculate score if every char or substring without whitespaces matched
}
// proceed to calculate score if every char or substring without whitespaces matched
if (allQuerySubstringsMatched)
{
var nearestSpaceIndex = CalculateClosestSpaceIndex(spaceIndices, firstMatchIndex);
@@ -202,8 +202,8 @@ namespace Wox.Infrastructure
}
return allMatch;
}
}
private static List<int> GetUpdatedIndexList(int startIndexToVerify, int currentQuerySubstringCharacterIndex, int firstMatchIndexInWord, List<int> indexList)
{
var updatedList = new List<int>();

View File

@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.ObjectModel;
using System.Drawing;
@@ -15,22 +15,22 @@ namespace Wox.Infrastructure.UserSettings
{
private string _hotkey = "Alt + Space";
private string _previousHotkey = string.Empty;
public string PreviousHotkey
public string PreviousHotkey
{
get
{
return _previousHotkey;
}
}
public string Hotkey
public string Hotkey
{
get
{
return _hotkey;
}
set
{
if (_hotkey != value)
@@ -41,27 +41,27 @@ namespace Wox.Infrastructure.UserSettings
}
}
}
public string Language { get; set; } = "en";
public string Theme { get; set; } = "Dark";
public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name;
public string QueryBoxFontStyle { get; set; }
public string QueryBoxFontWeight { get; set; }
public string QueryBoxFontStretch { get; set; }
public string ResultFont { get; set; } = FontFamily.GenericSansSerif.Name;
public string ResultFontStyle { get; set; }
public string ResultFontWeight { get; set; }
public string ResultFontStretch { get; set; }
/// <summary>
/// Gets or sets a value indicating whether when false Alphabet static service will always return empty results
/// </summary>
@@ -72,13 +72,13 @@ namespace Wox.Infrastructure.UserSettings
[JsonIgnore]
public string QuerySearchPrecisionString
{
get
{
return QuerySearchPrecision.ToString();
}
set
{
get
{
return QuerySearchPrecision.ToString();
}
set
{
try
{
var precisionScore = (StringMatcher.SearchPrecisionScore)Enum
@@ -95,41 +95,41 @@ namespace Wox.Infrastructure.UserSettings
StringMatcher.Instance.UserSettingSearchPrecision = StringMatcher.SearchPrecisionScore.Regular;
throw;
}
}
}
}
}
public bool AutoUpdates { get; set; } = false;
public double WindowLeft { get; set; }
public double WindowTop { get; set; }
private int _maxResultsToShow = 4;
public int MaxResultsToShow
{
get
{
return _maxResultsToShow;
}
set
public int MaxResultsToShow
{
get
{
if (_maxResultsToShow != value)
{
_maxResultsToShow = value;
OnPropertyChanged();
return _maxResultsToShow;
}
set
{
if (_maxResultsToShow != value)
{
_maxResultsToShow = value;
OnPropertyChanged();
}
}
}
}
public int ActivateTimes { get; set; }
// Order defaults to 0 or -1, so 1 will let this property appear last
[JsonProperty(Order = 1)]
public PluginSettings PluginSettings { get; set; } = new PluginSettings();
public ObservableCollection<CustomPluginHotkey> CustomPluginHotkeys { get; set; } = new ObservableCollection<CustomPluginHotkey>();
[Obsolete]
@@ -139,37 +139,37 @@ namespace Wox.Infrastructure.UserSettings
public OpacityMode OpacityMode { get; set; } = OpacityMode.Normal;
public bool DontPromptUpdateMsg { get; set; }
public bool EnableUpdateLog { get; set; }
public bool StartWoxOnSystemStartup { get; set; } = true;
public bool HideOnStartup { get; set; }
private bool _hideNotifyIcon;
public bool HideNotifyIcon
{
get
{
return _hideNotifyIcon;
}
set
{
_hideNotifyIcon = value;
OnPropertyChanged();
}
get
{
return _hideNotifyIcon;
}
set
{
_hideNotifyIcon = value;
OnPropertyChanged();
}
}
public bool LeaveCmdOpen { get; set; }
public bool HideWhenDeactivated { get; set; } = true;
public bool ClearInputOnLaunch { get; set; } = false;
public bool RememberLastLaunchLocation { get; set; }
public bool IgnoreHotkeysOnFullscreen { get; set; }
public HttpProxy Proxy { get; set; } = new HttpProxy();
@@ -192,4 +192,4 @@ namespace Wox.Infrastructure.UserSettings
LayeredWindow = 1,
DWM = 2,
}
}
}