editor: display error when no file specified, adapt to 80 column display by default
FossilOrigin-Name: 6898501e970ad192f73cb610395482b3952fb8e9f6d690f334880191b3f55c60
This commit is contained in:
parent
604fd85578
commit
1beb845cf9
1 changed files with 12 additions and 7 deletions
|
@ -1,10 +1,15 @@
|
||||||
#!/usr/bin/env retro
|
#!/usr/bin/env retro
|
||||||
|
_ _
|
||||||
|
| | | |_ _ __ _
|
||||||
|
| |_| | | | |/ _` |
|
||||||
|
| _ | |_| | (_| |
|
||||||
|
|_| |_|\__,_|\__,_|
|
||||||
|
line oriented editor
|
||||||
|
|
||||||
# Hua: a text editor written in RETRO
|
# Hua: a text editor written in RETRO
|
||||||
|
|
||||||
Hua is a small, functional text editor written in RETRO, using
|
Hua is a small, functional text editor written in RETRO for
|
||||||
the *RRE* interface. It is line oriented, visual, and tries to
|
Unix systems. It is line oriented, visual, and easy to learn.
|
||||||
be very simple to use.
|
|
||||||
|
|
||||||
## Starting
|
## Starting
|
||||||
|
|
||||||
|
@ -19,8 +24,8 @@ To create a new file:
|
||||||
## A Word of Warning
|
## A Word of Warning
|
||||||
|
|
||||||
Hua saves changes as you edit the file. I advise using it along
|
Hua saves changes as you edit the file. I advise using it along
|
||||||
with a version control system so you can revert changes if or
|
with a version control system so you can revert changes when
|
||||||
when needed.
|
needed.
|
||||||
|
|
||||||
## The Code
|
## The Code
|
||||||
|
|
||||||
|
@ -28,7 +33,7 @@ Since this runs as a standalone application I use a quick check
|
||||||
to exit if no arguments were passed.
|
to exit if no arguments were passed.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
sys:argc n:zero? [ #0 unix:exit ] if
|
sys:argc n:zero? [ 'No_file_specified! s:put nl #0 unix:exit ] if
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
If I get here, a filename was provided. So I start by creating
|
If I get here, a filename was provided. So I start by creating
|
||||||
|
@ -39,7 +44,7 @@ from the file to show on screen, and the name of the temporary
|
||||||
file to use when editing.
|
file to use when editing.
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
#80 'COLS const
|
#70 'COLS const
|
||||||
#16 'MAX-LINES const
|
#16 'MAX-LINES const
|
||||||
'/tmp/rre.edit 'TEMP-FILE s:const
|
'/tmp/rre.edit 'TEMP-FILE s:const
|
||||||
~~~
|
~~~
|
||||||
|
|
Loading…
Reference in a new issue