Jump to content

- - - - -

[Release] FATTEXT.G4B: text-editor for grub4dos


  • Please log in to reply
No replies to this topic

#1 deomsh


    Frequent Member

  • Advanced user
  • 195 posts

Posted 20 March 2023 - 10:04 PM

FATTEXT.G4B: text-editor for grub4dos - first release (link to the download location: Release v1.0)

Simple text-editor to write text-files and add, insert and edit lines.
Grubutil FAT is mandatory, and is used for saving (saving only on FAT-devices!).

FATTEXT.G4B is not a conventional editor, but operates with individual lines.
More or less the same as the grub4dos menu-editor, but with more functionality. However the grub4dos menu-editor has access to the full command-line (in a separate 'window').

FATTEXT.G4B uses the 'set /p' command-line, so max 510 chars, and no starting space just like the regular command-line in grub4dos. In most modes there is 'cheating': starting char 'underscore' is converted to a starting space. Longer lines can be made by (backwards) joining lines.

Editing long lines is done by splitting in smaller parts. So not convenient, but most of the time not a 'real' issue.
The convenient part of the 'set /p' command-line is direct access to the grub4dos History Buffer. Especially because cut/ copied/ edited lines are copied to the History Buffer first (based on sub-routines I developed for KEYBUFF.G4B - now HISTBUFF.G4B).

Some action print-screens.

First print-screen shows a file after opening from command-line, directly in Edit-mode, with menu-items. On last line there are messages and length of the 'active' line:

FATTEXT v1.0 print-screen I Edit mode after opening text-file from command-line.jpg

Second print-screen shows next 'page', after PageDown (or using 'T'). Length of 'active' line is highlighted, will be split if edited:

FATTEXT v1.0 print-screen II Next page in Edit mode - line length highlighted.jpg

BTW: pages are continually calculated. Going down is 'best', going up is not always fully the same if the page was filled up with first part(s) of a line.

Third print-screen shows help for Edit Menu after pressing F1. As can be seen more to the bottom, there are some hidden menu-items like Ctrl+O, Ctrl+S, Ctrl+B and my favorite: Alt+F4:

FATTEXT v1.0 print-screen III Help for Edit mode with F1.jpg

Fourth print-screen shows editing of a line, if longer than 74 chars the wrapped parts can be still seen during editing (see Line 13):

FATTEXT v1.0 print-screen IV Editing a longer line with wrapped part visible.jpg

BTW: the 'set /p' command-line is not so fast however, 'walking' with ArrowRight or ArrowLeft. Further Home or End only.

Fifth print-screen shows the result of the search-function (at the limit of max 80 chars), with replace-command-line already activated, ready to replace:

FATTEXT v1.0 print-screen V Search and ready to Replace.jpg

BTW: on the bottom a greyed-out message can be seen with more details about the Replace function

Sixth print-screen shows the Main Menu, some functions like New (text-file), (Save)As, Convert and Graphics can only be accessed from in this menu:

FATTEXT v1.0 print-screen VI Main Menu - active line with normal text-color.jpg

BTW: last active line is still visible, but has normal text-color.

Seventh print-screen shows the Convert Menu:

FATTEXT v1.0 print-screen VII Convert Menu.jpg

BTW: inside FATTEXT.G4B always MS-DOS text-mode is used, Unix/ (old) Mac text-modes are auto-converted during opening and saving. So convert to another mode is an extra function to change the text-mode type of an existing file.

Eighth print-screen shows the Graphics Menu, item Color (28 presets), ninth and tenth print-screen's are showing two results after changing Color. On tenth print-screen History of the Open Menu is showed, choosing by number 0-9 is possible, a bit like MS-DOS editor 'Edit':

FATTEXT v1.0 print-screen VIII Graphics Menu - choosing new Color.jpg FATTEXT v1.0 print-screen IX After choosing Color-preset White-on-Blue.jpg FATTEXT v1.0 print-screen X Menu Open - after choosing Color-preset Yellow-on-Black.jpg

BTW: all configurations are saved to the file FATTEXT.DAT, Color too.

Eleventh print-screen shows a new function I have not seen in the text-editors I normally use: Backup file to a different name, without changing the name inside the editor. Menu-item File is already activated, original file-name is 'raised' from the History Buffer ready for editing:

FATTEXT v1.0 print-screen XI Back up As - File activated ready for editing.jpg

Last print-screen shows the folder/ file Browser:

FATTEXT v1.0 print-screen XII Browser.jpg

BTW: the Browser is a bit primitive, only viewing folders/ files, choosing by manually inserting number-of-choice. In Save-mode new folders can be made on a FAT-device by inserting them in item Path, one menu-level up (full path must be used or inserted, new folders are immediately created - max 18 levels 'deep').

More information is in the Readme on GitHub.

I started this project about two years ago, most complicated project I ever worked on.
I'de like to thank Wonko the Sane and steve6375 for help and advice.

More details about the project can be found in my thread 'Writing to the Grub4dos' keyboard buffer possible?',
starting here: http://reboot.pro/in...=22450&p=218439

#2 deomsh


    Frequent Member

  • Advanced user
  • 195 posts

Posted 13 May 2023 - 05:59 PM

Double post removed

#3 deomsh


    Frequent Member

  • Advanced user
  • 195 posts

Posted 13 May 2023 - 06:00 PM

I have to report a few bugs, one bug can have more serious consequences. I am working on a new version without those bugs and with some new functionalty.

BUG#1: Only shortly seeing char 'e' on line 3 while 'Write' in Edit menu ('W') [reason: message too long].
BUG#2: Not restore original graphicsmode after 'FATTEXT /?' or after message if grubutil 'fat' not loaded [reason not running 'call (md)0x220+1'].
BUG#3: Clipboard overwritten with whole file after splitting long line [reason: function: 'mdreadinsertEOL' is using function 'mdread2mdwrite' instead of function 'mdread2mddraft' (unlike 'good' functions 'mdreadcutselection' or 'mdreadroomselection'].
BUG4#: Selection with 'Sel' in Edit menu ('S') is visually not updated if 'active' line appears to be the last line of text.

BUG#1 is fully harmless, only visible on very slow systems like Limbo x86.

About BUG#2: good to remember graphicsmode is changed inside FATTEXT.G4B (except for text mode and 480x640). Original graphicsmode is saved before, in a small batchfile located at (md)0x220+1. Original graphicsmode is (or should be) restored after closing FATTEXT.G4B (together with original color/ debug/ pager status).

About BUG#3: after auto-splitting a long line in case of 'Edit' ('E'), the 'P' in 'Paste' will be active, not longer greyed out (if clipboard is empty). Afterwards (or if already active by earlier cut/ copy: clipboard is overwritten wih whole file-content), 'dangerous' if pasting WITHOUT new cut/ copy after splitting long line. Good to know: clipboard is emptied if copying an empty line.

BUG4# can be annoying, as such harmless.

BTW in Virtual Box is a bug which disables one function in FATTEXT.G4B: key Ctrl+Del is not working, at least not with my (Dutch) keyboard. So after finding a phrase with 'Find' ('F', 'Ctrl+F' or 'Alt+F') deleting corresponding 'whole' line is not available (in this case with 'Del' -or 'D'- only the found phrase INSIDE the line is deleted. I made 'Ctrl+D' to have the option to ALWAYS delete a whole line.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users