LineEditor 2.79

Command-line history
Post Reply
JonAbbott
Posts: 3341
Joined: Thu Apr 11, 2013
Location: Essex
Contact:

LineEditor 2.79

Post by JonAbbott »

LineEditor provides command-line history at command prompts (eg. Supervisor, BASIC etc.)
It is 26/32bit neutral and runs on RISC OS 3.1x to RISC OS 5.x

Install via PackMan or manually run LineEditor from the attachment below. To run at boot, copy LineEditor to !Boot.Choices.Boot.Tasks

Changes in 2.79:
  • removed commented code and tidied help
  • moved modflags to be after code
  • changed the special char in the dictionary to ^
Changes in v2.78:
  • RISCOS311% added to avoid use of Dynamic Areas
  • ROM% added to prevent errors being reported during init
Changes in v2.77:
  • ReadLineV now preserves R4

Key combinations
Escape or Ctrl-[Abandon current line and do not insert in buffer
Tab or Ctrl-IFilename completion (beeps if no match)
InsertToggle insert and overtype modes for one line only
CopyAllow normal screen copying for one line only
Shift-InsertClear and remove single line from history
Shift-DeleteDelete character directly under cursor
Ctrl-DeleteClear line and erase entire history
Cursor UpCycle backwards through previous commands
Cursor DownCycle forwards through previous commands
Cursor LeftMove cursor one character to the left
Cursor RightMove cursor one character to the right
Shift-Cursor LeftMove cursor to end of previous word
Shift-Cursor RightMove cursor to start of next word
Ctrl-Cursor UpRecall the oldest previous command
Ctrl-Cursor DownRecall the newest previous command
Ctrl-Cursor LeftMove cursor to start of line
Ctrl-Cursor RightMove cursor to end of line
Backspace or Ctrl-HIdentical to Delete
Ctrl-J or Ctrl-MIdentical to Return
Ctrl-UClear entire line
~<substring>recalls command whose start uniquely matches <substring>

Substring Recall
You can recall a command, providing the start of the command matches <substring>

For example, if the following commands were used previously:
*Help Commands
*Mount 0
*Info *
PRINT"HELLO"

~<substring> can recall as follows:
~P will recall PRINT"HELLO"
~*M will recall *Mount 0
~*h will recall *Help Commands because the system is case insensitive

If there is no recall match when RETURN is pressed, then the leading tildes are stripped off and the command is executed as if the tildes weren't specified.
Attachments
LineEditor279_src.zip
BASICTxt source (24th Nov 2026)
(48.52 KiB) Downloaded 12 times
LineEditor279.zip
Module + !Help (24th Nov 2026)
(9.99 KiB) Downloaded 10 times
philpem
Posts: 3
Joined: Sun May 19, 2019

Re: LineEditor 2.79

Post by philpem »

Is this derived from the version which I used to maintain on github and removed from distribution?

The change history mirrors mine almost exactly in terms of sequence, but the dates differ. Just slightly confused about whether we've ended up doing the same job twice without ever realising.
JonAbbott
Posts: 3341
Joined: Thu Apr 11, 2013
Location: Essex
Contact:

Re: LineEditor 2.79

Post by JonAbbott »

philpem wrote: Wed Nov 25, 2026 Is this derived from the version which I used to maintain on github and removed from distribution?
I obtained the source code from Darren Salt in 2014 and have been modifying it since then. I made most of the changes as part of RISC OS 3.20.

I suspect some of your changes will have derived from where I've posted about fixes/changes I've made and you've mirrored them into your version.
colemanr
Posts: 2
Joined: Wed Nov 25, 2026

Re: LineEditor 2.79

Post by colemanr »

My fix for when a Task Window is closed causing an abort isn't included in this version.
After line 924
BCS badreadc
need to add 2 lines:
ORRVS R8,R8,#fEsc% ; Set ESCAPE flag, so we exit with C set as if Escape had been pressed
BVS leaveedit
JonAbbott
Posts: 3341
Joined: Thu Apr 11, 2013
Location: Essex
Contact:

Re: LineEditor 2.79

Post by JonAbbott »

colemanr wrote: Wed Nov 25, 2026 My fix for when a Task Window is closed causing an abort isn't included in this version.
Thanks. What's the SOE for that Abort?

There is at least one random Abort that I occasionally see, which I was trying to repro last week so I could fix it before releasing. Typically, I couldn't reproduce it, so I'm wondering if this might be the issue.

EDIT: Hold on, your fix is directly after an OS_ReadC - which can't return with V set, unless something else hanging of OS_ReadC and is setting V?
colemanr
Posts: 2
Joined: Wed Nov 25, 2026

Re: LineEditor 2.79

Post by colemanr »

Sorry, but what's SOE?

ROOL forum discussion at https://www.riscosopen.org/forum/forums/4/topics/17436 and the fix in Phil's github is at https://github.com/philpem/LineEditor/pull/5.

And just looking at the RISC OS source for OS_ReadLine (in kernel.s.Middle) it has a BVS ReadLine_VSet after a SWI XOS_ReadC, so it definitely can return with V set.
JonAbbott
Posts: 3341
Joined: Thu Apr 11, 2013
Location: Essex
Contact:

Re: LineEditor 2.79

Post by JonAbbott »

colemanr wrote: Thu Nov 26, 2026 Sorry, but what's SOE?
Sequence of events
colemanr wrote: Thu Nov 26, 2026 looking at the RISC OS source for OS_ReadLine (in kernel.s.Middle) it has a BVS ReadLine_VSet after a SWI XOS_ReadC, so it definitely can return with V set.
I'll check the OS_ReadC source and update the OS documentation if it can return with V set, as that's currently undocumented behaviour.
JonAbbott
Posts: 3341
Joined: Thu Apr 11, 2013
Location: Essex
Contact:

Re: LineEditor 2.79

Post by JonAbbott »

JonAbbott wrote: Thu Nov 26, 2026 I'll check the OS_ReadC source and update the OS documentation if it can return with V set, as that's currently undocumented behaviour.
I've updated the OS_ReadC documentation. It can return an error if file redirection is occurring and a file SWI returns an error, which wasn't documented in either the PRM's or the Wiki.

I have also checked through all occurrences of OS_ReadC in the OS and it's not consistently handling errors, so that needs looking at and potentially reporting if there's any instances where it might cause an issue.
Post Reply