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

add a develop menu, and undo/repo edit #110

Merged
merged 3 commits into from
Aug 29, 2023
Merged

add a develop menu, and undo/repo edit #110

merged 3 commits into from
Aug 29, 2023

Conversation

ltaoist
Copy link

@ltaoist ltaoist commented Aug 29, 2023

A. The Develop Menu

A Develop Menu can be see. However, its code let as a extendsion. I don't confident that how position a requirement that fit to different language/project/convention for "develop". Here I add something I need, so I think should this take as a "extendsion"?

ss

A.1 Pop os file window. Click this option will open the system file manager to visit current opened file.

A.2 "Python REPL". When click this option will be interact in terminal, and can access app, api, extendsion, get_text, get_path for debug and inspect the internal. May be better that open a standalone window for such a scripting issue?

A.3 "Project Build". This will trigger a system call to run build command. I want to call a custom build program, not make. Here is the build program: https://github.com/punblock/monkey/blob/main/monkey.py.

I confuse how to organize this all for a long time. Free feel for suggest or proposal or resight this issue.

B. The undo/redo Operation

The undo/redo Operation is available now, but it really base on a stupid and heavily way.

(1) Any modified should divide into "user edit” or "procedural edit". It is a cause that user may repeat undo-redo randomly but not actually type or make new input. So there is seen as a "user-edit" - "procedural edit" cycle. While in a user-edit, there are new status for edit, and after may be undo and redo. While in a procedural edit, the text did also changed, but user is not care this is as "normal" edit invoke by himself. Procedural edit may not atomic to tk, it may programmely delete, add, insert one or more char in the text. A correct undo/redo implicit the text between every time a user-edit done, not how the procedural edit.

For example, user input "A", and paste "sweet", as click a button, in imagely, occure a text download from web insert into the text for 5 times. There is just three "user-edit"; but may many "procedural edit". For Example, while paste "sweet", it may edit 5 time for each char.While download the text chunk from web, it insert 5 times but it only one "user edit”.

(2) After every user-edit did done, save full the text into a stack. And while undo/repo, just fetch the history or history-future text from the stack, and place it.

Full it check every times edit occur and do a full-text compare; it may slow in huge file editing.

C. Code style or commit issue

I don't confiden how to do.

All and all, tell me any suggest that what is in need, how to do will be better, for a solution or for biscuit :-D

Copy link
Owner

@tomlin7 tomlin7 left a comment

Choose a reason for hiding this comment

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

First of all, thank you for the great contribution! ❤

The undo-redo system implemented works really well and i'm surprised how neat it is! (also i am really sorry that you had to struggle because the project's code is not properly documented yet 😅 The extensions API also have to be documented properly)

Also noticed that the addition to menu came as an extension, thats nice but we can move it to https://github.com/billyeatcookies/biscuit-extensions as its language specific. This also reminds me that there should be a Menu endpoint for the extensions API to add menu items conveniently (thanks to you!)

Also just pointing out that the "Reveal in Explorer" and "Open in Integrated Terminal" options are available when you write click in explorer directory tree! :))

@tomlin7
Copy link
Owner

tomlin7 commented Aug 29, 2023

@ltaoist the develop menu extension has been added to extension repository with the name "Monkey". I will be improving the extensions GUI to include descriptions and more later! :))

see here https://github.com/billyeatcookies/biscuit-extensions

@tomlin7 tomlin7 requested review from tomlin7 and removed request for tomlin7 August 29, 2023 18:57
@tomlin7 tomlin7 merged commit 5543ed8 into tomlin7:main Aug 29, 2023
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.

2 participants