add a develop menu, and undo/repo edit #110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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"?
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