Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickable code search results line numbers. #1579

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

VladiStep
Copy link
Member

@VladiStep VladiStep commented Dec 23, 2023

Description

  1. Made the "Line (number)" part of the code search results lines clickable.
  2. Moved code editor related property (CodeEditorDecompile) and enum (CodeEditorMode) out from the MainWindow, and also renamed them.
  3. Fixed some variable names in the code search scripts.
  4. Added an optional overwrite argument for Tab.SaveTabContentState().

image

Fixes #1580.

@VladiStep VladiStep marked this pull request as ready for review December 24, 2023 16:58
UndertaleModCli/Program.UMTLibInherited.cs Outdated Show resolved Hide resolved
UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs Outdated Show resolved Hide resolved
UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs Outdated Show resolved Hide resolved
@VladiStep
Copy link
Member Author

VladiStep commented Dec 30, 2023

Why I merged "master" into it?

Copy link
Contributor

@Miepee Miepee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got no thoughts right now on how to get rid of the tuple, so fine by me with the exception of grammar.
the whole search thing needs to be rewritten in the future anyway. so lets not stall this feature for that.

@@ -298,25 +305,25 @@ private async void UserControl_DataContextChanged(object sender, DependencyPrope
CurrentDecompiled = null;
CurrentDisassembled = null;

if (MainWindow.CodeEditorDecompile != Unstated) //if opened from the code search results "link"
if (EditorTab != CodeEditorTab.Unknown) // if opened from the code search results "link"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use Uppercase If in comment.

int totalLineCount = resultsDict.Select(x => x.Value.Count).Sum();
bool tooManyLines = totalLineCount > 10000;
if (tooManyLines)
mainWindow.ShowWarning($"There are too many code lines to display ({totalLineCount}), so there would be no clickable line numbers.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mainWindow.ShowWarning($"There are too many code lines to display ({totalLineCount}), so there would be no clickable line numbers.");
mainWindow.ShowWarning($"There are too many code lines to display ({totalLineCount}), so no clickable line numbers are shown.");

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, what if "...so the line numbers won't be clickable."?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"won't" (will not) is future. you want present though.
Whether you use "so the line numbers aren't clickable" or "so no clickable line numbers are shown" doesnt really matter for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A "SearchASM.csx" script returns wrong line numbers sometimes.
2 participants