Skip to content

[Optimize]: to support using and editing history commands on Linux & macOS#3892

Merged
NGDAdmin merged 3 commits intoneo-project:masterfrom
Wi1l-B0t:optimize.read-line
Apr 15, 2025
Merged

[Optimize]: to support using and editing history commands on Linux & macOS#3892
NGDAdmin merged 3 commits intoneo-project:masterfrom
Wi1l-B0t:optimize.read-line

Conversation

@Wi1l-B0t
Copy link
Contributor

@Wi1l-B0t Wi1l-B0t commented Apr 9, 2025

Description

Now users can enter and edit command & history commands like a shell

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Wi1l-B0t Wi1l-B0t force-pushed the optimize.read-line branch from dc0703b to f534df0 Compare April 9, 2025 14:48
@Jim8y
Copy link
Contributor

Jim8y commented Apr 9, 2025

i have no idea why, but on windows it can get history command since the begining... not on linux.

@Jim8y
Copy link
Contributor

Jim8y commented Apr 10, 2025

When i type in command, prompt neo> turns yellow, which is not a correct behavior

@Wi1l-B0t Wi1l-B0t force-pushed the optimize.read-line branch from f534df0 to f7560ec Compare April 10, 2025 01:37
@Wi1l-B0t
Copy link
Contributor Author

When i type in command, prompt neo> turns yellow, which is not a correct behavior

Fixed

@Wi1l-B0t Wi1l-B0t force-pushed the optimize.read-line branch 6 times, most recently from 8a3d12d to f34a534 Compare April 10, 2025 15:59
@Jim8y Jim8y requested a review from Copilot April 10, 2025 21:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +51 to 52
var possibleHelp = "";
var commandArgs = CommandToken.Parse(commandLine).ToArray();
Copy link

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

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

The variable 'possibleHelp' is declared but never used. If it isn’t serving a future purpose, consider removing it to clean up the code.

Suggested change
var possibleHelp = "";
var commandArgs = CommandToken.Parse(commandLine).ToArray();

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

Is not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is not used?

False Positive

{
input.Insert(cursor, key.KeyChar);
cursor++;
if (cursor < input.Length) rewrite();
Copy link

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

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

After inserting a character, the call to 'rewrite()' is only executed when the cursor is not at the end of the input; consider calling 'rewrite()' unconditionally to ensure the prompt display is always updated.

Suggested change
if (cursor < input.Length) rewrite();
rewrite();

Copilot uses AI. Check for mistakes.
@Jim8y
Copy link
Contributor

Jim8y commented Apr 10, 2025

works fine, but with one small problem, the cursor can go all the way to the left..

image

@Wi1l-B0t
Copy link
Contributor Author

works fine, but with one small problem, the cursor can go all the way to the left..

image

Which platform?

@Wi1l-B0t Wi1l-B0t force-pushed the optimize.read-line branch from f34a534 to b6ab344 Compare April 11, 2025 01:43
@Wi1l-B0t
Copy link
Contributor Author

works fine, but with one small problem, the cursor can go all the way to the left..

image

Fixed

@Wi1l-B0t Wi1l-B0t changed the title [Optimize]: to support using and editing history commands. [Optimize]: to support using and editing history commands in Linux & macOS Apr 11, 2025
@Wi1l-B0t Wi1l-B0t changed the title [Optimize]: to support using and editing history commands in Linux & macOS [Optimize]: to support using and editing history commands on Linux & macOS Apr 11, 2025
@Wi1l-B0t Wi1l-B0t force-pushed the optimize.read-line branch from b6ab344 to 308bca7 Compare April 12, 2025 02:00
@Jim8y Jim8y requested a review from NGDAdmin April 12, 2025 02:29
@Jim8y Jim8y added the NGD Review This pr is an UT/Benchmark PR, NGD can review. label Apr 12, 2025
Copy link
Member

@superboyiii superboyiii left a comment

Choose a reason for hiding this comment

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

It works well on mine

@NGDAdmin NGDAdmin merged commit f7b7682 into neo-project:master Apr 15, 2025
6 of 7 checks passed
@Wi1l-B0t Wi1l-B0t deleted the optimize.read-line branch April 17, 2025 12:53
Jim8y added a commit to Jim8y/neo that referenced this pull request Apr 17, 2025
* master:
  DBFTPlugin: include consensus time into block interval (neo-project#3900)
  Isolate unit tests (neo-project#3904)
  Use DateTime.UtcNow (neo-project#3902)
  Update workflow (neo-project#3901)
  optimize: show state more readable (neo-project#3899)
  Optimize KeyedCollectionSlim (neo-project#3877)
  Native: move MillisecondsPerBlock setting to native Policy (neo-project#3895)
  optimize: history command support (neo-project#3892)
  Ensure that view interops can't be changed outside (neo-project#3812)
cschuchardt88 pushed a commit to cschuchardt88/neo that referenced this pull request Jun 8, 2025
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: NGD Admin <154295625+NGDAdmin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NGD Review This pr is an UT/Benchmark PR, NGD can review. Ready to Merge Waiting for Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants