TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: BOB FEHRENBACH
date: 1997-07-01 06:54:00
subject: Alternate HOME and END functions

From: bfehrenb@execpc.com (Bob Fehrenbach)
In some editors, BRIEF e.g., subsequent presses of the HOME key take the
cursor to the beginning of the line, the beginning of the screen and the
beginning of the file, in that order.  The end key acts similarly in the
opposite direction.  Turns out that adding this to TSE is rather easy.
In case anyone would like to try, here is what I used:
//  Alternate definition of home key function
//  home - go to column 1.  If already at column 1, go to beginning
//         of the screen.  If at the beginning of the screen, go to
//         start of file.
   proc n_home()
   if (BegLine()  0)
      return()
   else
      if (BegWindow()  0)
      return()
   else
      BegFile()
   endif
   endif
end
//  Alternate definition of end key function
//  Similar to home key above.  Goes end of line, end of screen,
//  end of file.
   proc n_end()
    if (EndLine()  0)
        return()
    else
        if(EndWindow()  0)
        EndLine()              //EndWindow may not put cursor at end of line
        return()
    else
        EndFile()
    endif
    endif
end
Add the above to your tse.ui file, change the HOME and END key
bindings as below, and recompile.
//                  BegLine()
//                   EndLine()
                  n_home()
                   n_end()
--
Bob Fehrenbach    Wauwatosa, WI     bfehrenb@execpc.com
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.