Browse Source

Clean up bookmark nits: HandleExceptions, dead method, asset typo

- Route the bookmarks pane's double-click and next/previous navigation through
  HandleExceptions() rather than discarding the Task with `_ =`, so an exception
  raised during navigation reaches the global handler instead of vanishing.
- Drop the unused parameterless NextDefaultName() overload.
- Rename the misspelled Boomark.Disable.svg asset (and its loader string) to
  Bookmark.Disable.svg.

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3839/head
Siegfried Pammer 1 week ago committed by Siegfried Pammer
parent
commit
0cfeddbc97
  1. 0
      ILSpy/Assets/Icons/Bookmark.Disable.svg
  2. 2
      ILSpy/Bookmarks/BookmarkManager.cs
  3. 2
      ILSpy/Bookmarks/BookmarksPane.axaml.cs
  4. 2
      ILSpy/Bookmarks/BookmarksPaneModel.cs
  5. 5
      ILSpy/Images.cs

0
ILSpy/Assets/Icons/Boomark.Disable.svg → ILSpy/Assets/Icons/Bookmark.Disable.svg

Before

Width:  |  Height:  |  Size: 865 B

After

Width:  |  Height:  |  Size: 865 B

2
ILSpy/Bookmarks/BookmarkManager.cs

@ -204,8 +204,6 @@ namespace ICSharpCode.ILSpy.Bookmarks
} }
} }
string NextDefaultName() => NextDefaultName(Bookmarks);
static string NextDefaultName(IEnumerable<Bookmark> bookmarks) static string NextDefaultName(IEnumerable<Bookmark> bookmarks)
{ {
// Pick the lowest unused "Bookmark{n}" so names stay stable and unsurprising. // Pick the lowest unused "Bookmark{n}" so names stay stable and unsurprising.

2
ILSpy/Bookmarks/BookmarksPane.axaml.cs

@ -35,7 +35,7 @@ namespace ICSharpCode.ILSpy.Bookmarks
{ {
if (DataContext is BookmarksPaneModel model && BookmarkGrid.SelectedItem is Bookmark bookmark) if (DataContext is BookmarksPaneModel model && BookmarkGrid.SelectedItem is Bookmark bookmark)
{ {
_ = model.ActivateAsync(bookmark); model.ActivateAsync(bookmark).HandleExceptions();
e.Handled = true; e.Handled = true;
} }
} }

2
ILSpy/Bookmarks/BookmarksPaneModel.cs

@ -133,7 +133,7 @@ namespace ICSharpCode.ILSpy.Bookmarks
{ {
int index = SelectedBookmark != null ? Bookmarks.IndexOf(SelectedBookmark) : -1; int index = SelectedBookmark != null ? Bookmarks.IndexOf(SelectedBookmark) : -1;
if (NextEnabledIndex(Bookmarks.Select(b => b.Enabled).ToList(), index, delta) is { } next) if (NextEnabledIndex(Bookmarks.Select(b => b.Enabled).ToList(), index, delta) is { } next)
_ = ActivateAsync(Bookmarks[next]); ActivateAsync(Bookmarks[next]).HandleExceptions();
} }
/// <summary> /// <summary>

5
ILSpy/Images.cs

@ -86,10 +86,9 @@ namespace ICSharpCode.ILSpy
public static readonly IImage ShowPrivateInternal = LoadSvg(nameof(ShowPrivateInternal)); public static readonly IImage ShowPrivateInternal = LoadSvg(nameof(ShowPrivateInternal));
public static readonly IImage ShowAll = LoadSvg(nameof(ShowAll)); public static readonly IImage ShowAll = LoadSvg(nameof(ShowAll));
// Bookmarks (file names carry dots, so they can't use nameof; "Boomark.Disable" is the // Bookmarks (file names carry dots, so the dotted variants can't use nameof).
// asset's actual -- misspelled -- file name).
public static readonly IImage Bookmark = LoadSvg(nameof(Bookmark)); public static readonly IImage Bookmark = LoadSvg(nameof(Bookmark));
public static readonly IImage BookmarkDisable = LoadSvg("Boomark.Disable"); public static readonly IImage BookmarkDisable = LoadSvg("Bookmark.Disable");
public static readonly IImage BookmarkNext = LoadSvg("Bookmark.Next"); public static readonly IImage BookmarkNext = LoadSvg("Bookmark.Next");
public static readonly IImage BookmarkPrevious = LoadSvg("Bookmark.Previous"); public static readonly IImage BookmarkPrevious = LoadSvg("Bookmark.Previous");
public static readonly IImage BookmarkNextInFile = LoadSvg("Bookmark.Next.File"); public static readonly IImage BookmarkNextInFile = LoadSvg("Bookmark.Next.File");

Loading…
Cancel
Save