FS#4864 - text editor for rockbox

Attached to Project: Rockbox
Opened by Jonathan Gordon (jdgordon) - Monday, 20 March 2006, 13:09 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


just a very simple text editor for rockbox..
ok, so the way this works is its a really simple line based editor.. load the file from the open with menu and it will display the whole file in the list (max line length is 128, and max lines is 1024, so 128kb which should fit nicely in all the targets plugin buffer cept the archos..)

press select to goto the keyboard and edit the current line (iriver: NAVI/middle button, ipod: select).
press menu to get a list of things u can do (iriver:a-b button, ipod:menu)
hopefully all the menu items are easy enough to understand...
pressing delete (iriver:rec, ipod:left) will remove the line and put it on the "clipboard" so u can paste it from the menu (use the insert before/after item)
and lastly, press exit (iriver: off, ipod:menu+select) to exit, you'll get a menu asking u if u want to save if the file has been changed.

the reason why ive only mentioned ipod and iriver keys is coz i dont know whats good on the other targets, so if u have an idea please reply with key combos.. (the delete button is optional, the rest are required).
This task depends upon

Closed by  Hristo Kovachev (bger)
Monday, 03 April 2006, 08:52 GMT
Reason for closing:  Accepted
Comment by Robert Kukla (roolku) - Monday, 20 March 2006, 13:20 GMT
Just to say that I have been using it for a while it find it extremly useful.
There seems to be a bug with 'cut' though (unless it has been fixed in this version - will try when I get home), It seems to fill the whole text buffer with the lines above the cursor. i.e.

line 1
line 2
line 3 <- cursor
line 4
line 5

will become:

line 1
line 2
line 1
line 2
line 1

Also as mentioned in my forum post, I would love to be able to break/join lines of text.

Comment by Jonathan Gordon (jdgordon) - Monday, 20 March 2006, 13:24 GMT
ah, damn.. ok, ye, just tested and that bug still exsists... ill have a look..
you can join lines now (use the cat to above menu item), but not split a line.. i cant tihnk of a nice, logical way to do it (ui wise)...
Comment by Jonathan Gordon (jdgordon) - Monday, 20 March 2006, 13:34 GMT
well.. that was a simple fix :p
new patch attached
Comment by Jonathan Gordon (jdgordon) - Tuesday, 21 March 2006, 10:49 GMT
ok, updated again.. you can now spliut a line into 2... i hate how ive done it, but i couldnt get any better way to work.. (i dont think its going to be used very often, so no big deal.)
to split a line, go into the menu, choose split line, then u need to remove the end of the line, the removed text then becomes the next line (inserted as a new line.. doesnt overwrite the cureent next line.)
Comment by Robert Kukla (roolku) - Sunday, 02 April 2006, 16:13 GMT
This doesn't work with current cvs anymore. :(

Any chance to have it updated (or even included in cvs)?

Thanks a lot!

Comment by Paul van der Heu (paulheu) - Sunday, 02 April 2006, 16:16 GMT
No problems here.. what is wrong for you?
Comment by Robert Kukla (roolku) - Sunday, 02 April 2006, 16:22 GMT
This is what I get with the patch Tuesday, 21 March 2006, 11:49AM:

$ patch -p0 < text_ed.patch
patching file apps/plugin.c
Hunk #1 FAILED at 411.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugin.c.rej
patching file apps/plugin.h
Hunk #1 FAILED at 479.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugin.h.rej
patching file apps/gui/list.c
patching file apps/gui/list.h
patching file apps/plugins/SOURCES
Hunk #1 FAILED at 16.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugins/SOURCES.rej
patching file apps/plugins/text_editor.c
patching file apps/plugins/viewers.config
Hunk #1 FAILED at 15.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugins/viewers.config.rej
Comment by Paul van der Heu (paulheu) - Sunday, 02 April 2006, 16:24 GMT
So you open the .rej file and put the changes in place manually
Comment by Robert Kukla (roolku) - Sunday, 02 April 2006, 17:18 GMT
That is what I wanted to avoid doing, hence my request for an updated patch.

Since you have already gone through the process, would you consider creating a patch for the benefit of others?

Thank you
Comment by Jonathan Gordon (jdgordon) - Sunday, 02 April 2006, 23:05 GMT
updated patch coming later this arvo
Comment by Jonathan Gordon (jdgordon) - Monday, 03 April 2006, 06:50 GMT
ok, here we go...
updated for the latest cvs... except i updated the wrong patch file, so the line splitting isnt in this version (good thing, coz i didnt like how it was being done anyway, ill submit a patch later with a better way if this makes it in before the free).

it needs button definitions for all targets except ipod and iriver, each target needs 3 buttons, select, menu, and quit/cancel....