News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

New Editor

Started by Biterider, March 04, 2025, 08:38:50 PM

Previous topic - Next topic

zedd151

#30
Quote from: TimoVJL on April 11, 2025, 08:50:55 PMADE open sqlite3.c in blink of eyes  :thumbsup:
sqlite3.c size was just 9 MB  :biggrin:
So great wiewer for big files  :thumbsup:
Some stats for you Biterider... by merging many many multiples of windows.inc from masm32 SDK.

I have made a huge file... not that I would expect any assembly source codes to be that large but who knows?  :tongue:

21521600 lines of text
781929600 bytes filesize

On my computer running an i7,
1. Using ADE, around 7 seconds for file to be displayed. Scrollable in full (even to the bottom), immediately after the file is displayed.  :thumbsup:  Big Huge improvement over programs that do use RichEdit.

2. Using qeditor, around 13 seconds to display the file, but still loading in the background. Not scrollable until fully loaded. Even then, scrolling to the bottom is nigh impossible.  :thdn:

3. Using Notepad, the program still loading after 30 seconds. Had to close via Task Manager.  :thdn:  :thdn:  :thdn:  I didn't explore Notepad any further.  :biggrin:

Side note:
Some time ago, I had experimented with using a couple of smaller buffers (1000 lines I think) which rotated and streamed the text into a RichEdit control from either of the two small buffers.  That was even much faster than streaming into the RichEdit control in one pass. I forget a lot of the details, but do remember it was tricky to implement and get it right, as well as work transparently to the user. I may still have that code somewhere buried in my archives.

Later: I remember now, I was playing around with making a hex editor back then... custom coded ascii hex byte selection, and corresponding ascii selection (if ascii text file was open) at the same time iirc, big phun.

I looked for it btw, everything that I had before 2019 is lost. I forgot about that, too. Long story about a 64 GB micro SD card... that I used for backups, old files etc. I never found the tiny thing.

zedd151

I finally had a chance to actually look at your IDE in operation.

Looks nice, but I found a minor issue.

WHen selecting a series of spaces in the whitespace, there appear to be some sort of beige highlighting the same size as the selection but elsewhere in the editor. It doesn't appear to have any effects other than looking odd.

Example the selection I made is in green:


There are a couple more images in the attachment.

Biterider

Hi Zedd
These are the things I'm interested in. The caret logic is a tricky one and needs a lot of attention.
Besides the screenshots, I'll need the file that's causing the problem. Is that OK?

Biterider

zedd151

#33
Quote from: Biterider on April 12, 2025, 04:44:53 AMI'll need the file that's causing the problem. Is that OK?

3 different files in the zip, corresponding to the images zipped and attached already above.

Attachment removed as it has served its intended purpose.


Biterider

Thanks Zedd  :thumbsup:
I found the problem. It was a logic error in the selection check in the highlighting implementation.
This feature highlights text in the view when a word is selected, for example when you double-click on a word. This allows you to immediately see other occurrences in a procedure. This is very useful when examining or refactoring code.
The fixed version is in the first post.

Regards, Biterider


zedd151


Biterider

Hi
After reading what other coders have done to implement undo/redo for editors, I came up with some ideas on how it could be done.
The interesting thing is that it can be done by tracking changes on each editor separately, or globally.
This means that in the latter case, if you make changes to different files (editors) and you can undo them seamlessly. The downside is that in this case you can't just undo the changes in a particular editor and leave the rest untouched.

For now, I think I'll go with the global approach.

Biterider

ognil

#37
Admin EDIT:
In 'approving' this rather 'Cryptic' informationless post, I thought it perhaps useful to include further information.
The provided 'link', points to an article called "Piece Chains", being a seemingly good and informative article on Editors by a chap called James Brown; https://www.catch22.net/about/
A LESS Cryptic and perhaps more helpully descriptive 'link' than that posted by the member:
https://www.catch22.net/tuts/neatpad/piece-chains/


->?   Original 'link' ??? I mean honestly,.. ???  :rolleyes:
NB: As Many people here are often (and very possibly rightly-so), cautious about merely opening, Non Described 'links'. May I suggest if your'e intention is to provide useful and helpful information, it surely can't hurt to spend just a small amount of time and effort to provide some information regarding What the 'link' is about etc.
"Not keeping emotions under control is another type of mental distortion."

Biterider

Hi
As my string tables are growing fast, I decided to try ChatGPT to do the job for me. Basically, I provide the English string table in the resources section, from which all displayed texts in the application come.
The idea: all other languages supported by the application should be translated by an LLM.

As a short example, I want to translate this into German, where some lines should only be partially translated:
  IDLANG_ENGLISH + 00, "&File|File commands"
  IDLANG_ENGLISH + 01, "&New|Create a new file"
  IDLANG_ENGLISH + 02, "&Open...~Ctrl+O|Open a file"
  IDLANG_ENGLISH + 03, "&Save~Ctrl+S|Save to file"
...
  IDLANG_ENGLISH + 40, "&Language|Language selection"
  IDLANG_ENGLISH + 41, "&English|English language"
  IDLANG_ENGLISH + 42, "&Deutsch|German language"
  IDLANG_ENGLISH + 43, "&Italiano|Italian language"
...

Using this ChatGPT prompt:
Translate the following lines to german following these rules:
For lines containing a number between 41 and 45 (inclusive), keep the text between the first quotation mark and the "|" character unchanged, and only translate the text after the "|" character to German.
Replace every occurrence of IDLANG_ENGLISH with IDLANG_GERMAN.
Ensure the final result is grammatically correct.

the result can be directly be pasted into the .rc file  :thumbsup:

  IDLANG_GERMAN + 00, "&Datei|Dateibefehle"
  IDLANG_GERMAN + 01, "&Neu|Neue Datei erstellen"
  IDLANG_GERMAN + 02, "&Öffnen...~Strg+O|Datei öffnen"
  IDLANG_GERMAN + 03, "&Speichern~Strg+S|In Datei speichern"
...
  IDLANG_GERMAN  + 40, "&Sprache|Sprachauswahl"
  IDLANG_GERMAN  + 41, "&English|Englische Sprache"
  IDLANG_GERMAN  + 42, "&Deutsch|Deutsche Sprache"
  IDLANG_GERMAN  + 43, "&Italiano|Italienische Sprache"
...

I have done this for German, Italian, Russian and Spanish and it works like a charm.  :bgrin:

Regards, Biterider

Biterider

Hi
I now have a concept and strategy for implementing the Undo/Redo feature. :cool:

Initially, I was on the wrong track, thinking that Undo/Redo should be a global feature across all open editor instances.
However, if you look at modern and advanced editors, they implement this feature per editor instance—meaning each editor tracks its own changes. 
This approach is much simpler!

That said, what seems simple now can become quite complex when it comes to caret manipulation. 
One possible solution might be to disable caret handling after an Undo/Redo operation and require the user to manually re-position it.

Biterider


zedd151

Quote from: Biterider on April 16, 2025, 02:37:00 AMInitially, I was on the wrong track, thinking that Undo/Redo should be a global feature across all open editor instances.

However, if you look at modern and advanced editors, they implement this feature per editor instance—meaning each editor tracks its own changes.
:thumbsup:  Yes. Trying to track changes across several instances globally would be a monumental feat, and undoubtedly lead to hard to track bugs.

Still, even doing it per editor instance is a very ambitious plan, to do it without the benefit of any aids like RichEdits built-in Undo/Redo capacity. I applaud your determination.

Biterider

Hi
Finally, I was able to implement the undo/redo feature, which was not as complicated as I expected, but not trivial either.
It boils down to having some basic insert and delete routines for characters and lines in a way that they complement each other. For example, you can undo the insert routine with the delete routine and vice versa.
Once that is in place, it is a matter of keeping track of the changes and sending them to the right routines to undo or redo an action.

A key element is the grouping and aggregation of actions. For example, deleting several lines at once needs to be perceived as a single action, not as deleting one line at a time. The solution is to group all these deletions together and process them together.

Aggregation is slightly different because it groups together single actions, such as keystrokes when typing a word. The whole sequence of keystrokes must also be perceived as a single action.

After implementing all this, I uploaded the new binary in the first post. I also added indentation/outdentation and comment/uncomment to the toolbars, and disabled SEH for the time being to make it easier to find the bugs.

Regards, Biterider


Biterider

Hi
Having done "most" of the core work, there is still the project management code to do.
In this respect, I would like to know what the general preferences are. 

  • Should the project files be organised by category in a tree view like most IDEs?
  • How fast should the project files be accessible? (max 2-3 clicks?) 
  • How should the tools be organised? (by menu entries, be project entries in the tree view, ...) 
  • How should the toolchain be organised for maximum flexibility?

Regards, Biterider




TimoVJL

As i am a Pelles C user, so i like to see project files in tree view.
Project files should be in form, where every object files are in their own folders.
So 32 / 64 bits and release and debug having own result folders
May the source be with you

Biterider

Hi
Thanks Timo. :thumbsup:
Lets see what other people here think.

There is one thing I haven't mentioned. That is code folding.
For those who use it, I have seen it done for other modern languages by simply using indentation.
Compared to using folding rules, this can be a big advantage for asm. With indentation, the coder can manage what he wants to see and what he does not want to see.
Similar to the way rules work, you have a trigger line at a lower indentation with a + or - square to show or hide the more indented lines.
I like this way because it gives a lot of flexibility.

Regards, Biterider