Skip to content

Commit

Permalink
[X16EDIT] sync from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
mooinglemur committed Mar 11, 2024
1 parent 6c886e9 commit cc69d6f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion x16-edit/.git-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ba1b4ae4455429fb64debe536dcb07cfc9fbe60f
7ebc2ecedd1370131c78cc7291540c5f73a3b7ee
27 changes: 25 additions & 2 deletions x16-edit/file.inc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,30 @@ io_err:
bra close_file

eof:
jsr writebuf
;Check if file ends with newline
ldx index
beq :+ ;Empty buffer, add final newline
lda file_buf-1,x
cmp #LF ;Last char is LF, no need to add final newline
beq :+++
cmp #CR ;Last char is CR, no need to add final newline
beq :+++

;Write buffer to file, and add final newline
: jsr writebuf

ldx file_linebreak_encoding
beq :+ ;newline=LF
lda #CR
jsr KERNAL_CHROUT
cpx #1 ;newline=CR
beq close_file
: lda #LF
jsr KERNAL_CHROUT
bra close_file

;File ends with newline, just write buffer to file
: jsr writebuf

close_file:
lda #1
Expand Down Expand Up @@ -1023,4 +1046,4 @@ file_ioerr_10:

.segment "RAMCODE3"
file_buf: .res 256
.CODE
.CODE
8 changes: 4 additions & 4 deletions x16-edit/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ available via a function key.
^D Set current device number
^T Set text color (default white)
^B Set background color (default blue)
^M Show memory usage (1 bank=251 bytes of text)
^M Show memory usage (1 block=251 bytes of text)
^SPACE Insert non-breaking space
^1..9 Set tab width
^ENTER Set line break encoding
^RETURN Set line break encoding
^F Programming toolbox (ROM only)


X16 Edit, Copyright 2020-2023, Stefan Jakobsson.
X16 Edit, Copyright 2020-2024, Stefan Jakobsson.

Released under the BSD 2-Clause license, available in
the enclosed "license" file.
the enclosed "license" file.
2 changes: 1 addition & 1 deletion x16-edit/help_short.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ N =New B=Backgr color
K =Cut M=Mem free
DEL =Del Ln C=Copy
1..9=Tab w U=Uncut/paste
ENT =Ln brk enc
RET =Ln brk enc

X16 Edit, (c) Stefan Jakobsson,
released under BSD 2-Clause
Expand Down

0 comments on commit cc69d6f

Please sign in to comment.