Skip to content

Commit 59f3f2b

Browse files
committed
Style tweaks
1 parent f683c2e commit 59f3f2b

6 files changed

Lines changed: 20 additions & 7 deletions

File tree

Flow.Launcher.Plugin.OneNote/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ private static async Task OneNoteInitAsync(CancellationToken token)
5959
{
6060
semaphore.Release();
6161
}
62-
6362
}
63+
6464
public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
6565
{
6666
Task init = OneNoteInitAsync(token);

Flow.Launcher.Plugin.OneNote/Search/NotebookExplorer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private List<Result> ShowAll(IOneNoteItem? parent, IEnumerable<IOneNoteItem> col
7474
.Select(item => resultCreator.CreateOneNoteItemResult(item, true))
7575
.ToList();
7676

77-
return results.Any() ? results : resultCreator.EmptyCollection(results, parent);
77+
return results.Count != 0 ? results : resultCreator.EmptyCollection(results, parent);
7878
}
7979

8080
private List<Result> ScopedSearch(string query, IOneNoteItem parent)
@@ -91,7 +91,7 @@ private List<Result> ScopedSearch(string query, IOneNoteItem parent)
9191
.Select(pg => resultCreator.CreatePageResult(pg, currentSearch))
9292
.ToList();
9393

94-
return results.Any() ? results : ResultCreator.NoMatchesFound();
94+
return results.Count != 0 ? results : ResultCreator.NoMatchesFound();
9595
}
9696

9797
private List<Result> Explorer(string search, IOneNoteItem? parent, IEnumerable<IOneNoteItem> collection)

Flow.Launcher.Plugin.OneNote/Search/SearchBase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ public abstract class SearchBase
77
protected readonly PluginInitContext context;
88
protected readonly Settings settings;
99
protected readonly ResultCreator resultCreator;
10+
#nullable disable
1011
public readonly Keyword keyword;
11-
protected SearchBase(PluginInitContext context, Settings settings, ResultCreator resultCreator, Keyword keyword)
12+
#nullable restore
13+
protected SearchBase(PluginInitContext context, Settings settings, ResultCreator resultCreator, Keyword? keyword)
1214
{
1315
this.context = context;
1416
this.settings = settings;

Flow.Launcher.Plugin.OneNote/Search/SearchManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public SearchManager(PluginInitContext context, Settings settings, ResultCreator
1515
notebookExplorer = new NotebookExplorer(context, settings, resultCreator, titleSearch);
1616
recentPages = new RecentPages(context, settings, resultCreator);
1717
defaultSearch = new DefaultSearch(context, settings, resultCreator);
18-
1918
}
2019

2120
public List<Result> Query(string search)

Flow.Launcher.Plugin.OneNote/Search/TitleSearch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public List<Result> Filter(string query, IOneNoteItem? parent, IEnumerable<IOneN
2525
.Select(x => resultCreator.CreateOneNoteItemResult(x.Item, false, x.HighlightData, x.Score))
2626
.ToList();
2727

28-
return results.Any() ? results : ResultCreator.NoMatchesFound();
28+
return results.Count != 0 ? results : ResultCreator.NoMatchesFound();
2929
}
3030
}
3131
}

Flow.Launcher.Plugin.OneNote/UI/ViewModels/NewOneNotePageViewModel.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,20 @@ public NewOneNotePageViewModel(PluginInitContext context, Section? section, stri
2525
private void CreatePage(bool openImmediately)
2626
{
2727
var page = OneNoteApp.CreatePage(section, PageTitle);
28+
var xmlWrap = $"""
29+
<one:Outline>
30+
<one:Position x="36.0" y="86.4000015258789" z="0"/>
31+
<one:Size width="72.0" height="13.42771339416504"/>
32+
<one:OEChildren>
33+
<one:OE alignment="left">
34+
<one:T>
35+
<![CDATA[{PageContent}]]>
36+
</one:T>
37+
</one:OE>
38+
</one:OEChildren>
39+
</one:Outline>
40+
""";
2841
var pageContentXml = page.GetPageContent();
29-
var xmlWrap = $"<one:Outline><one:Position x=\"36.0\" y=\"86.4000015258789\" z=\"0\"/><one:Size width=\"72.0\" height=\"13.42771339416504\"/><one:OEChildren><one:OE alignment=\"left\"><one:T><![CDATA[{PageContent}]]></one:T></one:OE></one:OEChildren></one:Outline>";
3042
pageContentXml = pageContentXml.Insert(pageContentXml.IndexOf("</one:Page>", StringComparison.Ordinal), xmlWrap);
3143
OneNoteApp.UpdatePageContent(pageContentXml);
3244
context.API.ReQuery();

0 commit comments

Comments
 (0)