Skip to content

Commit

Permalink
fed: Make cc at the last line work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
meithecatte committed Mar 12, 2023
1 parent b8b6e77 commit de989a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions files/fed.fth
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ variable is-linewise
(buf) fs-cmove r> negate #buf +! mark ;

( insert mode )
: (insert-char) ( c -- ) >pos dup 1 make-space b! ;
: insert-char keypress lobyte dup printable? if
>pos dup 1 make-space b! right else drop unbound then ;
(insert-char) right else drop unbound then ;
keymap insert insert-char
: insert-modeline ." -- INSERT --" ;
: insert-mode ['] insert-modeline is modeline
Expand All @@ -282,14 +283,15 @@ keymap insert insert-char
>> #bs bind insert
: delete-after ( -- ) >pos 1 delete-range ensure-eol ;
>> char x bind normal
: enter ( -- ) >pos dup 1 make-space #lf swap b! down lbegin ;
: enter ( -- ) #lf (insert-char) down lbegin ;
>> #cr bind insert

( ways of entering insert mode )
: prepend lbegin insert-mode ; >> char I bind normal
: append-lend lend insert-mode ; >> char A bind normal
: append right insert-mode ; >> char a bind normal
: insert-above lbegin enter up insert-mode ; >> char O bind normal
: insert-above lbegin #lf (insert-char) insert-mode ;
>> char O bind normal
: insert-below lend enter insert-mode ; >> char o bind normal

( user-facing commands )
Expand Down

0 comments on commit de989a9

Please sign in to comment.