Not logged in

Artifact 2f7c38b3c374344167b6f4dd2360a39c30a9963b

File rxe.extensions.retro part of check-in [a3e8421a4a] - fix shoveline, describe b and B by luke on 2010-06-05 16:09:54. [annotate]


( RxE :: Extensions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
(                                                             )
( Key    Description                                          )
( ---    ---------------------------------------------------  )
(  b     Pull blank line up to current line                   )
(  B     Shove blank line to the last non-blank line          )
(  y     Move the current line into the yank buffer           )
(  Y     Copy the yank buffer contents to the current line    )
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
&rxe::keys open
&rxe::core open

{
  : isBlank? ( -f )
    @line (line) 64 for @+ 32 !if drop 0 ;then next drop -1 ;
  : toBlank  ( -  )
    repeat line ++ isBlank? if; again ;
  : swaplines
    @line dup 1- (line) swap (line) 2dup here 64 copy
    swap 64 copy here swap 64 copy ;
  : pullspace
    @line toBlank repeat @line over =if drop line ++ bounds ;then
    swaplines line -- again ;
  : shovespace
    line -- bounds
    @line repeat
    line ++ isBlank? swaplines if !line ;then
    again ;

  : $$b pullspace  ; &rxe::keys >vocab
  : $$B shovespace ; &rxe::keys >vocab
}

{
  create yib 64 allot
  : this   ( -a ) @line (line) ;
  : delete ( -  ) this 64 for 32 swap !+ next drop ;
  : $$y    ( -  ) this yib 64 copy delete ;  &rxe::keys >vocab
  : $$Y    ( -  ) yib this 64 copy ;         &rxe::keys >vocab
}

&rxe::core shut
&rxe::keys shut