Skip to content

Commit

Permalink
Added document Home and End support to zeptoed
Browse files Browse the repository at this point in the history
  • Loading branch information
tabemann committed Jul 7, 2024
1 parent fb1de4f commit 8512d21
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/extra/zeptoed.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ zeptoed has the following key mappings; all other non-control characters will be
* Down: Move the cursor down by one row.
* Page Up: Move the cursor up by roughly one screen.
* Page Down: Move the cursor down by roughly one screen.
* Home: Move the cursor to the start of the document.
* End: Move the cursor to the nd of the document.
* Control-Space: Toggle selection; if there previously was no selection, the selection point is set to the current position of the cursor.
* Control-A: Move the cursor to the start of the line; note that under many terminal programs (GNU Screen, picocom) Control-A is captured, and generating a Control-A requires more keys to be entered (e.g. entering Control-A again under picocom).
* Control-E: Move the cursor to the end of the line.
Expand Down
Binary file modified epub/.doctrees/environment.pickle
Binary file not shown.
Binary file modified epub/.doctrees/extra/zeptoed.doctree
Binary file not shown.
4 changes: 2 additions & 2 deletions epub/content.opf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<dc:publisher>Travis Bemann</dc:publisher>
<dc:rights>2020-2024, Travis Bemann</dc:rights>
<dc:identifier id="unknown">unknown</dc:identifier>
<dc:date>2024-07-06T16:11:40Z</dc:date>
<meta property="dcterms:modified">2024-07-06T16:11:40Z</meta>
<dc:date>2024-07-07T12:42:18Z</dc:date>
<meta property="dcterms:modified">2024-07-07T12:42:18Z</meta>
<meta property="ibooks:version"></meta>
<meta property="ibooks:specified-fonts">true</meta>
<meta property="ibooks:binding">true</meta>
Expand Down
2 changes: 2 additions & 0 deletions epub/extra/zeptoed.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
<li><p>Down: Move the cursor down by one row.</p></li>
<li><p>Page Up: Move the cursor up by roughly one screen.</p></li>
<li><p>Page Down: Move the cursor down by roughly one screen.</p></li>
<li><p>Home: Move the cursor to the start of the document.</p></li>
<li><p>End: Move the cursor to the nd of the document.</p></li>
<li><p>Control-Space: Toggle selection; if there previously was no selection, the selection point is set to the current position of the cursor.</p></li>
<li><p>Control-A: Move the cursor to the start of the line; note that under many terminal programs (GNU Screen, picocom) Control-A is captured, and generating a Control-A requires more keys to be entered (e.g. entering Control-A again under picocom).</p></li>
<li><p>Control-E: Move the cursor to the end of the line.</p></li>
Expand Down
Binary file modified epub/zeptoforth.epub
Binary file not shown.
62 changes: 62 additions & 0 deletions extra/common/zeptoed.fs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,12 @@ begin-module zeptoed-internal
\ Page down in buffer
method do-page-down ( buffer -- )

\ Home in buffer
method do-doc-home ( buffer -- )
\ End in buffer
method do-doc-end ( buffer -- )
\ Indent in buffer
method do-indent ( buffer -- )
Expand Down Expand Up @@ -597,6 +603,12 @@ begin-module zeptoed-internal
\ Page down in buffer
method handle-page-down ( buffer -- )
\ Home in buffer
method handle-doc-home ( buffer -- )
\ End in buffer
method handle-doc-end ( buffer -- )
\ Indent in buffer
method handle-indent ( buffer -- )
Expand Down Expand Up @@ -832,6 +844,12 @@ begin-module zeptoed-internal
\ Handle editor page down
method handle-editor-page-down ( editor -- )
\ Handle editor home
method handle-editor-doc-home ( editor -- )
\ Handle editor end
method handle-editor-doc-end ( editor -- )
\ Handle editor indent
method handle-editor-indent ( editor -- )
Expand Down Expand Up @@ -2098,6 +2116,16 @@ begin-module zeptoed-internal
then
loop
; define do-page-down
\ Home in buffer
:noname { buffer -- }
buffer buffer-left-bound @ buffer buffer-edit-cursor go-to-offset
; define do-doc-home
\ End in buffer
:noname { buffer -- }
buffer buffer-edit-cursor go-to-end
; define do-doc-end
\ Indent in buffer
:noname { buffer -- }
Expand Down Expand Up @@ -2554,6 +2582,20 @@ begin-module zeptoed-internal
buffer refresh-display
; define handle-page-down
\ Home in buffer
:noname { buffer -- }
buffer do-doc-home
buffer update-display drop
buffer refresh-display
; define handle-doc-home
\ End in buffer
:noname { buffer -- }
buffer do-doc-end
buffer update-display drop
buffer refresh-display
; define handle-doc-end
\ Indent in buffer
:noname { buffer -- }
buffer do-indent
Expand Down Expand Up @@ -3399,6 +3441,24 @@ begin-module zeptoed-internal
then
; define handle-editor-page-down
\ Handle editor home
:noname { editor -- }
editor editor-in-minibuffer @ if
editor editor-minibuffer @ handle-doc-home
else
editor editor-current @ handle-doc-home
then
; define handle-editor-doc-home
\ Handle editor end
:noname { editor -- }
editor editor-in-minibuffer @ if
editor editor-minibuffer @ handle-doc-end
else
editor editor-current @ handle-doc-end
then
; define handle-editor-doc-end
\ Handle editor indent
:noname { editor -- }
editor editor-in-minibuffer @ if
Expand Down Expand Up @@ -3432,6 +3492,8 @@ begin-module zeptoed-internal
[char] B of editor handle-editor-down endof
[char] C of editor handle-editor-forward endof
[char] D of editor handle-editor-backward endof
[char] F of editor handle-editor-doc-end endof
[char] H of editor handle-editor-doc-home endof
[char] Z of editor handle-editor-unindent endof
[char] 3 of
get-key case
Expand Down
Binary file modified html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified html/.doctrees/extra/zeptoed.doctree
Binary file not shown.
2 changes: 2 additions & 0 deletions html/_sources/extra/zeptoed.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ zeptoed has the following key mappings; all other non-control characters will be
* Down: Move the cursor down by one row.
* Page Up: Move the cursor up by roughly one screen.
* Page Down: Move the cursor down by roughly one screen.
* Home: Move the cursor to the start of the document.
* End: Move the cursor to the nd of the document.
* Control-Space: Toggle selection; if there previously was no selection, the selection point is set to the current position of the cursor.
* Control-A: Move the cursor to the start of the line; note that under many terminal programs (GNU Screen, picocom) Control-A is captured, and generating a Control-A requires more keys to be entered (e.g. entering Control-A again under picocom).
* Control-E: Move the cursor to the end of the line.
Expand Down
2 changes: 2 additions & 0 deletions html/extra/zeptoed.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ <h2>Key mappings<a class="headerlink" href="#key-mappings" title="Permalink to t
<li><p>Down: Move the cursor down by one row.</p></li>
<li><p>Page Up: Move the cursor up by roughly one screen.</p></li>
<li><p>Page Down: Move the cursor down by roughly one screen.</p></li>
<li><p>Home: Move the cursor to the start of the document.</p></li>
<li><p>End: Move the cursor to the nd of the document.</p></li>
<li><p>Control-Space: Toggle selection; if there previously was no selection, the selection point is set to the current position of the cursor.</p></li>
<li><p>Control-A: Move the cursor to the start of the line; note that under many terminal programs (GNU Screen, picocom) Control-A is captured, and generating a Control-A requires more keys to be entered (e.g. entering Control-A again under picocom).</p></li>
<li><p>Control-E: Move the cursor to the end of the line.</p></li>
Expand Down
2 changes: 1 addition & 1 deletion html/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 8512d21

Please sign in to comment.