Yet another regression, this time cascading from commit 3953. My
scenario wasn't actually testing what I thought it was testing.
This commit is contained in:
Kartik K. Agaram 2017-06-27 11:16:36 -07:00
parent 9a7e1a0f36
commit 0f0be736fb
7 changed files with 3025 additions and 3005 deletions

View File

@ -1419,6 +1419,9 @@ def move-to-next-line editor:&:editor, screen-height:num -> go-render?:bool, edi
{
next:&:duplex-list:char <- next before-cursor
break-unless next
c:char <- get *next, value:offset
at-newline?:bool <- equal c, 10/newline
break-if at-newline?
done?:bool <- greater-or-equal cursor-column, target-column
break-if done?
cursor-column <- add cursor-column, 1
@ -1438,13 +1441,16 @@ def move-to-next-line editor:&:editor, screen-height:num -> go-render?:bool, edi
scenario editor-adjusts-column-at-next-line [
local-scope
assume-screen 10/width, 5/height
s:text <- new [abc
de]
# second line is shorter than first
s:text <- new [abcde
fg
hi]
e:&:editor <- new-editor s, 0/left, 10/right
editor-render screen, e
$clear-trace
# move to end of first line, then press down
assume-console [
left-click 1, 3
left-click 1, 8
press down-arrow
]
run [
@ -1452,6 +1458,7 @@ de]
3:num/raw <- get *e, cursor-row:offset
4:num/raw <- get *e, cursor-column:offset
]
# cursor doesn't go vertically down, it goes to end of shorter line
memory-should-contain [
3 <- 2
4 <- 2
@ -1465,10 +1472,10 @@ de]
]
screen-should-contain [
. .
.abc .
.de0 .
.abcde .
.fg0 .
.hi .
.┈┈┈┈┈┈┈┈┈┈.
. .
]
]

File diff suppressed because it is too large Load Diff

View File

@ -361,7 +361,7 @@ if ('onhashchange' in window) {
<span id="L298" class="LineNr"> 298 </span> <span class="Conceal">¦</span> row <span class="Special">&lt;-</span> add row,<span class="Constant"> 1</span>
<span id="L299" class="LineNr"> 299 </span> <span class="Conceal">¦</span> <a href='../081print.mu.html#L16'>screen</a> <span class="Special">&lt;-</span> move-cursor <a href='../081print.mu.html#L16'>screen</a>, row, left
<span id="L300" class="LineNr"> 300 </span> <span class="Conceal">¦</span> sandbox-data:text <span class="Special">&lt;-</span> get *sandbox, <span class="Constant">data:offset</span>
<span id="L301" class="LineNr"> 301 </span> <span class="Conceal">¦</span> row, <a href='../081print.mu.html#L16'>screen</a> <span class="Special">&lt;-</span> <a href='003-shortcuts.mu.html#L2055'>render-code</a> <a href='../081print.mu.html#L16'>screen</a>, sandbox-data, left, right, row
<span id="L301" class="LineNr"> 301 </span> <span class="Conceal">¦</span> row, <a href='../081print.mu.html#L16'>screen</a> <span class="Special">&lt;-</span> <a href='003-shortcuts.mu.html#L2062'>render-code</a> <a href='../081print.mu.html#L16'>screen</a>, sandbox-data, left, right, row
<span id="L302" class="LineNr"> 302 </span> <span class="Conceal">¦</span> *sandbox <span class="Special">&lt;-</span> put *sandbox, <span class="Constant">code-ending-row-on-screen:offset</span>, row
<span id="L303" class="LineNr"> 303 </span> <span class="Conceal">¦</span> <span class="Comment"># render sandbox warnings, screen or response, in that order</span>
<span id="L304" class="LineNr"> 304 </span> <span class="Conceal">¦</span> sandbox-response:text <span class="Special">&lt;-</span> get *sandbox, <span class="Constant">response:offset</span>
@ -848,7 +848,7 @@ if ('onhashchange' in window) {
<span id="L785" class="LineNr"> 785 </span> <span class="Conceal">¦</span> <span class="Comment"># cursor back to top line</span>
<span id="L786" class="LineNr"> 786 </span> <span class="Conceal">¦</span> press up-arrow
<span id="L787" class="LineNr"> 787 </span> <span class="Conceal">¦</span> <span class="Comment"># try to scroll</span>
<span id="L788" class="LineNr"> 788 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a> <span class="Comment"># or ctrl-f</span>
<span id="L788" class="LineNr"> 788 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a> <span class="Comment"># or ctrl-f</span>
<span id="L789" class="LineNr"> 789 </span> ]
<span id="L790" class="LineNr"> 790 </span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
<span id="L791" class="LineNr"> 791 </span> <span class="Comment"># no scroll, and cursor remains at top line</span>
@ -917,7 +917,7 @@ if ('onhashchange' in window) {
<span id="L854" class="LineNr"> 854 </span> <span class="Comment"># switch to sandbox window and hit 'page-down'</span>
<span id="L855" class="LineNr"> 855 </span> assume-console [
<span id="L856" class="LineNr"> 856 </span> <span class="Conceal">¦</span> press ctrl-n
<span id="L857" class="LineNr"> 857 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L857" class="LineNr"> 857 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L858" class="LineNr"> 858 </span> ]
<span id="L859" class="LineNr"> 859 </span> run [
<span id="L860" class="LineNr"> 860 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -935,7 +935,7 @@ if ('onhashchange' in window) {
<span id="L872" class="LineNr"> 872 </span> ]
<span id="L873" class="LineNr"> 873 </span> <span class="Comment"># hit 'page-up'</span>
<span id="L874" class="LineNr"> 874 </span> assume-console [
<span id="L875" class="LineNr"> 875 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3813'>page-up</a>
<span id="L875" class="LineNr"> 875 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3820'>page-up</a>
<span id="L876" class="LineNr"> 876 </span> ]
<span id="L877" class="LineNr"> 877 </span> run [
<span id="L878" class="LineNr"> 878 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1059,7 +1059,7 @@ if ('onhashchange' in window) {
<span id="L996" class="LineNr"> 996 </span> ]
<span id="L997" class="LineNr"> 997 </span> <span class="Comment"># hit 'page-down'</span>
<span id="L998" class="LineNr"> 998 </span> assume-console [
<span id="L999" class="LineNr"> 999 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L999" class="LineNr"> 999 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1000" class="LineNr">1000 </span> ]
<span id="L1001" class="LineNr">1001 </span> run [
<span id="L1002" class="LineNr">1002 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1081,7 +1081,7 @@ if ('onhashchange' in window) {
<span id="L1018" class="LineNr">1018 </span> ]
<span id="L1019" class="LineNr">1019 </span> <span class="Comment"># hit 'page-down' again</span>
<span id="L1020" class="LineNr">1020 </span> assume-console [
<span id="L1021" class="LineNr">1021 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L1021" class="LineNr">1021 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1022" class="LineNr">1022 </span> ]
<span id="L1023" class="LineNr">1023 </span> run [
<span id="L1024" class="LineNr">1024 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1098,7 +1098,7 @@ if ('onhashchange' in window) {
<span id="L1035" class="LineNr">1035 </span> ]
<span id="L1036" class="LineNr">1036 </span> <span class="Comment"># hit 'page-down' again</span>
<span id="L1037" class="LineNr">1037 </span> assume-console [
<span id="L1038" class="LineNr">1038 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L1038" class="LineNr">1038 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1039" class="LineNr">1039 </span> ]
<span id="L1040" class="LineNr">1040 </span> run [
<span id="L1041" class="LineNr">1041 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1115,7 +1115,7 @@ if ('onhashchange' in window) {
<span id="L1052" class="LineNr">1052 </span> ]
<span id="L1053" class="LineNr">1053 </span> <span class="Comment"># hit 'page-up'</span>
<span id="L1054" class="LineNr">1054 </span> assume-console [
<span id="L1055" class="LineNr">1055 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3813'>page-up</a>
<span id="L1055" class="LineNr">1055 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3820'>page-up</a>
<span id="L1056" class="LineNr">1056 </span> ]
<span id="L1057" class="LineNr">1057 </span> run [
<span id="L1058" class="LineNr">1058 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1134,7 +1134,7 @@ if ('onhashchange' in window) {
<span id="L1071" class="LineNr">1071 </span> ]
<span id="L1072" class="LineNr">1072 </span> <span class="Comment"># hit 'page-up' again</span>
<span id="L1073" class="LineNr">1073 </span> assume-console [
<span id="L1074" class="LineNr">1074 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3813'>page-up</a>
<span id="L1074" class="LineNr">1074 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3820'>page-up</a>
<span id="L1075" class="LineNr">1075 </span> ]
<span id="L1076" class="LineNr">1076 </span> run [
<span id="L1077" class="LineNr">1077 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1156,7 +1156,7 @@ if ('onhashchange' in window) {
<span id="L1093" class="LineNr">1093 </span> ]
<span id="L1094" class="LineNr">1094 </span> <span class="Comment"># hit 'page-up' again</span>
<span id="L1095" class="LineNr">1095 </span> assume-console [
<span id="L1096" class="LineNr">1096 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3813'>page-up</a>
<span id="L1096" class="LineNr">1096 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3820'>page-up</a>
<span id="L1097" class="LineNr">1097 </span> ]
<span id="L1098" class="LineNr">1098 </span> run [
<span id="L1099" class="LineNr">1099 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1206,7 +1206,7 @@ if ('onhashchange' in window) {
<span id="L1143" class="LineNr">1143 </span> ]
<span id="L1144" class="LineNr">1144 </span> <span class="Comment"># hit 'page-down' and 'page-up' a couple of times. sandbox index should be stable</span>
<span id="L1145" class="LineNr">1145 </span> assume-console [
<span id="L1146" class="LineNr">1146 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L1146" class="LineNr">1146 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1147" class="LineNr">1147 </span> ]
<span id="L1148" class="LineNr">1148 </span> run [
<span id="L1149" class="LineNr">1149 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1224,7 +1224,7 @@ if ('onhashchange' in window) {
<span id="L1161" class="LineNr">1161 </span> ]
<span id="L1162" class="LineNr">1162 </span> <span class="Comment"># hit 'page-up' again</span>
<span id="L1163" class="LineNr">1163 </span> assume-console [
<span id="L1164" class="LineNr">1164 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3813'>page-up</a>
<span id="L1164" class="LineNr">1164 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3820'>page-up</a>
<span id="L1165" class="LineNr">1165 </span> ]
<span id="L1166" class="LineNr">1166 </span> run [
<span id="L1167" class="LineNr">1167 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
@ -1242,7 +1242,7 @@ if ('onhashchange' in window) {
<span id="L1179" class="LineNr">1179 </span> ]
<span id="L1180" class="LineNr">1180 </span> <span class="Comment"># hit 'page-down'</span>
<span id="L1181" class="LineNr">1181 </span> assume-console [
<span id="L1182" class="LineNr">1182 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L1182" class="LineNr">1182 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1183" class="LineNr">1183 </span> ]
<span id="L1184" class="LineNr">1184 </span> run [
<span id="L1185" class="LineNr">1185 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>

View File

@ -225,7 +225,7 @@ if ('onhashchange' in window) {
<span id="L163" class="LineNr">163 </span> <span class="Conceal">¦</span> press F4
<span id="L164" class="LineNr">164 </span> <span class="Conceal">¦</span> type <span class="Constant">[add 1, 1]</span>
<span id="L165" class="LineNr">165 </span> <span class="Conceal">¦</span> press F4
<span id="L166" class="LineNr">166 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L166" class="LineNr">166 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L167" class="LineNr">167 </span> ]
<span id="L168" class="LineNr">168 </span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
<span id="L169" class="LineNr">169 </span> screen-should-contain [
@ -272,7 +272,7 @@ if ('onhashchange' in window) {
<span id="L210" class="LineNr">210 </span> <span class="Conceal">¦</span> press F4
<span id="L211" class="LineNr">211 </span> <span class="Conceal">¦</span> type <span class="Constant">[add 1, 1]</span>
<span id="L212" class="LineNr">212 </span> <span class="Conceal">¦</span> press F4
<span id="L213" class="LineNr">213 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L213" class="LineNr">213 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L214" class="LineNr">214 </span> ]
<span id="L215" class="LineNr">215 </span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
<span id="L216" class="LineNr">216 </span> screen-should-contain [
@ -319,8 +319,8 @@ if ('onhashchange' in window) {
<span id="L257" class="LineNr">257 </span> <span class="Conceal">¦</span> press F4
<span id="L258" class="LineNr">258 </span> <span class="Conceal">¦</span> type <span class="Constant">[add 1, 1]</span>
<span id="L259" class="LineNr">259 </span> <span class="Conceal">¦</span> press F4
<span id="L260" class="LineNr">260 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L261" class="LineNr">261 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L260" class="LineNr">260 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L261" class="LineNr">261 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L262" class="LineNr">262 </span> ]
<span id="L263" class="LineNr">263 </span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
<span id="L264" class="LineNr">264 </span> screen-should-contain [
@ -385,8 +385,8 @@ if ('onhashchange' in window) {
<span id="L323" class="LineNr">323 </span> <span class="Comment"># delete the second sandbox, then try to scroll down twice</span>
<span id="L324" class="LineNr">324 </span> assume-console [
<span id="L325" class="LineNr">325 </span> <span class="Conceal">¦</span> left-click<span class="Constant"> 3</span>,<span class="Constant"> 99</span>
<span id="L326" class="LineNr">326 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L327" class="LineNr">327 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L326" class="LineNr">326 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L327" class="LineNr">327 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L328" class="LineNr">328 </span> ]
<span id="L329" class="LineNr">329 </span> run [
<span id="L330" class="LineNr">330 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>

View File

@ -281,8 +281,8 @@ if ('onhashchange' in window) {
<span id="L219" class="LineNr">219 </span> <span class="Conceal">¦</span> press F4
<span id="L220" class="LineNr">220 </span> <span class="Conceal">¦</span> type <span class="Constant">[add 1, 1]</span>
<span id="L221" class="LineNr">221 </span> <span class="Conceal">¦</span> press F4
<span id="L222" class="LineNr">222 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L223" class="LineNr">223 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L222" class="LineNr">222 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L223" class="LineNr">223 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L224" class="LineNr">224 </span> ]
<span id="L225" class="LineNr">225 </span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>
<span id="L226" class="LineNr">226 </span> screen-should-contain [
@ -367,9 +367,9 @@ if ('onhashchange' in window) {
<span id="L305" class="LineNr">305 </span> ]
<span id="L306" class="LineNr">306 </span> <span class="Comment"># now try to scroll past end</span>
<span id="L307" class="LineNr">307 </span> assume-console [
<span id="L308" class="LineNr">308 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L309" class="LineNr">309 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L310" class="LineNr">310 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L308" class="LineNr">308 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L309" class="LineNr">309 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L310" class="LineNr">310 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L311" class="LineNr">311 </span> ]
<span id="L312" class="LineNr">312 </span> run [
<span id="L313" class="LineNr">313 </span> <span class="Conceal">¦</span> <a href='004-programming-environment.mu.html#L39'>event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, env, <a href='../088file.mu.html#L11'>resources</a>

View File

@ -1081,7 +1081,7 @@ if ('onhashchange' in window) {
<span id="L1018" class="LineNr">1018 </span> <a href='002-typing.mu.html#L265'>editor-render</a> <a href='../081print.mu.html#L16'>screen</a>, e
<span id="L1019" class="LineNr">1019 </span> <span class="Comment"># scroll the page</span>
<span id="L1020" class="LineNr">1020 </span> assume-console [
<span id="L1021" class="LineNr">1021 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L1021" class="LineNr">1021 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1022" class="LineNr">1022 </span> ]
<span id="L1023" class="LineNr">1023 </span> <a href='002-typing.mu.html#L16'>editor-event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, e
<span id="L1024" class="LineNr">1024 </span> <span class="Comment"># undo</span>
@ -1115,7 +1115,7 @@ if ('onhashchange' in window) {
<span id="L1052" class="LineNr">1052 </span> <a href='002-typing.mu.html#L265'>editor-render</a> <a href='../081print.mu.html#L16'>screen</a>, e
<span id="L1053" class="LineNr">1053 </span> <span class="Comment"># scroll the page down and up</span>
<span id="L1054" class="LineNr">1054 </span> assume-console [
<span id="L1055" class="LineNr">1055 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L1055" class="LineNr">1055 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1056" class="LineNr">1056 </span> <span class="Conceal">¦</span> press ctrl-b
<span id="L1057" class="LineNr">1057 </span> ]
<span id="L1058" class="LineNr">1058 </span> <a href='002-typing.mu.html#L16'>editor-event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, e
@ -1150,8 +1150,8 @@ if ('onhashchange' in window) {
<span id="L1087" class="LineNr">1087 </span> <a href='002-typing.mu.html#L265'>editor-render</a> <a href='../081print.mu.html#L16'>screen</a>, e
<span id="L1088" class="LineNr">1088 </span> <span class="Comment"># scroll the page down and up</span>
<span id="L1089" class="LineNr">1089 </span> assume-console [
<span id="L1090" class="LineNr">1090 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3590'>page-down</a>
<span id="L1091" class="LineNr">1091 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3813'>page-up</a>
<span id="L1090" class="LineNr">1090 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3597'>page-down</a>
<span id="L1091" class="LineNr">1091 </span> <span class="Conceal">¦</span> press <a href='003-shortcuts.mu.html#L3820'>page-up</a>
<span id="L1092" class="LineNr">1092 </span> ]
<span id="L1093" class="LineNr">1093 </span> <a href='002-typing.mu.html#L16'>editor-event-loop</a> <a href='../081print.mu.html#L16'>screen</a>, <a href='../084console.mu.html#L23'>console</a>, e
<span id="L1094" class="LineNr">1094 </span> <span class="Comment"># undo</span>
@ -2031,10 +2031,10 @@ if ('onhashchange' in window) {
<span id="L1968" class="LineNr">1968 </span> ]
<span id="L1969" class="LineNr">1969 </span>]
<span id="L1970" class="LineNr">1970 </span>
<span id="L1971" class="LineNr">1971 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L2533'>&lt;delete-to-end-of-line-begin&gt;</a></span> [
<span id="L1971" class="LineNr">1971 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L2540'>&lt;delete-to-end-of-line-begin&gt;</a></span> [
<span id="L1972" class="LineNr">1972 </span> top-before:&amp;:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special">&lt;-</span> get *editor, <span class="Constant">top-of-screen:offset</span>
<span id="L1973" class="LineNr">1973 </span>]
<span id="L1974" class="LineNr">1974 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L2535'>&lt;delete-to-end-of-line-end&gt;</a></span> [
<span id="L1974" class="LineNr">1974 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L2542'>&lt;delete-to-end-of-line-end&gt;</a></span> [
<span id="L1975" class="LineNr">1975 </span> <span class="Delimiter">{</span>
<span id="L1976" class="LineNr">1976 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> deleted-cells <span class="Comment"># delete failed; don't add an undo operation</span>
<span id="L1977" class="LineNr">1977 </span> <span class="Conceal">¦</span> top-after:&amp;:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special">&lt;-</span> get *editor, <span class="Constant">top-of-screen:offset</span>
@ -2134,10 +2134,10 @@ if ('onhashchange' in window) {
<span id="L2071" class="LineNr">2071 </span> ]
<span id="L2072" class="LineNr">2072 </span>]
<span id="L2073" class="LineNr">2073 </span>
<span id="L2074" class="LineNr">2074 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1956'>&lt;delete-to-start-of-line-begin&gt;</a></span> [
<span id="L2074" class="LineNr">2074 </span><span class="muRecipe">after</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1963'>&lt;delete-to-start-of-line-begin&gt;</a></span> [
<span id="L2075" class="LineNr">2075 </span> top-before:&amp;:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special">&lt;-</span> get *editor, <span class="Constant">top-of-screen:offset</span>
<span id="L2076" class="LineNr">2076 </span>]
<span id="L2077" class="LineNr">2077 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1958'>&lt;delete-to-start-of-line-end&gt;</a></span> [
<span id="L2077" class="LineNr">2077 </span><span class="muRecipe">before</span> <span class="Constant"><a href='003-shortcuts.mu.html#L1965'>&lt;delete-to-start-of-line-end&gt;</a></span> [
<span id="L2078" class="LineNr">2078 </span> <span class="Delimiter">{</span>
<span id="L2079" class="LineNr">2079 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> deleted-cells <span class="Comment"># delete failed; don't add an undo operation</span>
<span id="L2080" class="LineNr">2080 </span> <span class="Conceal">¦</span> top-after:&amp;:<a href='../065duplex_list.mu.html#L3'>duplex-list</a>:char <span class="Special">&lt;-</span> get *editor, <span class="Constant">top-of-screen:offset</span>

View File

@ -390,7 +390,6 @@ def delete-at-cursor editor:&:editor, screen:&:screen -> go-render?:bool, delete
at-right?:bool <- greater-or-equal curr-column, screen-width
return-if at-right?, 1/go-render
break-unless curr
# newline? done.
currc:char <- get *curr, value:offset
at-newline?:bool <- equal currc, 10/newline
break-if at-newline?
@ -1332,7 +1331,7 @@ after <handle-special-key> [
move-to-next-line?:bool <- equal k, 65516/down-arrow
break-unless move-to-next-line?
<move-cursor-begin>
editor <- move-to-next-line editor, screen-height
move-to-next-line editor, screen-height
undo-coalesce-tag:num <- copy 4/down-arrow
<move-cursor-end>
return
@ -1376,6 +1375,9 @@ def move-to-next-line editor:&:editor, screen-height:num -> editor:&:editor [
{
next:&:duplex-list:char <- next before-cursor
break-unless next
c:char <- get *next, value:offset
at-newline?:bool <- equal c, 10/newline
break-if at-newline?
done?:bool <- greater-or-equal cursor-column, target-column
break-if done?
cursor-column <- add cursor-column, 1
@ -1390,13 +1392,16 @@ def move-to-next-line editor:&:editor, screen-height:num -> editor:&:editor [
scenario editor-adjusts-column-at-next-line [
local-scope
assume-screen 10/width, 5/height
s:text <- new [abc
de]
# second line is shorter than first
s:text <- new [abcde
fg
hi]
e:&:editor <- new-editor s, 0/left, 10/right
editor-render screen, e
$clear-trace
# move to end of first line, then press down
assume-console [
left-click 1, 3
left-click 1, 8
press down-arrow
]
run [
@ -1404,6 +1409,7 @@ de]
3:num/raw <- get *e, cursor-row:offset
4:num/raw <- get *e, cursor-column:offset
]
# cursor doesn't go vertically down, it goes to end of shorter line
memory-should-contain [
3 <- 2
4 <- 2
@ -1417,10 +1423,10 @@ de]
]
screen-should-contain [
. .
.abc .
.de0 .
.abcde .
.fg0 .
.hi .
.┈┈┈┈┈┈┈┈┈┈.
. .
]
]