diff options
author | Valery Ushakov <uwe@stderr.spb.ru> | 2017-01-11 23:23:58 +0300 |
---|---|---|
committer | Valery Ushakov <uwe@stderr.spb.ru> | 2017-01-11 23:23:58 +0300 |
commit | 546783184a373a2dd59afef3affe029a6aedd701 (patch) | |
tree | be78a83372b1574f70c6b40fbc9af1f4dc7156a7 | |
parent | 01a16ff9f126fc08a38d7c7c96fd936c16555178 (diff) | |
parent | 39d2105807e5fdd337df2cb2907631b2ba5afad3 (diff) |
Merged inferno-os/inferno-os into default
-rw-r--r-- | appl/acme/ecmd.b | 2 | ||||
-rw-r--r-- | appl/acme/look.b | 4 | ||||
-rw-r--r-- | appl/acme/row.b | 2 | ||||
-rw-r--r-- | appl/acme/text.b | 63 | ||||
-rw-r--r-- | appl/acme/text.m | 2 | ||||
-rw-r--r-- | appl/acme/util.b | 2 | ||||
-rw-r--r-- | appl/acme/wind.b | 2 | ||||
-rw-r--r-- | appl/acme/xfid.b | 8 | ||||
-rw-r--r-- | dis/acme.dis | bin | 24374 -> 24374 bytes | |||
-rw-r--r-- | dis/acme/acme.dis | bin | 24374 -> 24374 bytes | |||
-rw-r--r-- | dis/acme/buff.dis | bin | 3426 -> 3426 bytes | |||
-rw-r--r-- | dis/acme/col.dis | bin | 9113 -> 9113 bytes | |||
-rw-r--r-- | dis/acme/dat.dis | bin | 587 -> 587 bytes | |||
-rw-r--r-- | dis/acme/disk.dis | bin | 1501 -> 1501 bytes | |||
-rw-r--r-- | dis/acme/ecmd.dis | bin | 15443 -> 15448 bytes | |||
-rw-r--r-- | dis/acme/edit.dis | bin | 6827 -> 6827 bytes | |||
-rw-r--r-- | dis/acme/elog.dis | bin | 3064 -> 3064 bytes | |||
-rw-r--r-- | dis/acme/exec.dis | bin | 19072 -> 19072 bytes | |||
-rw-r--r-- | dis/acme/file.dis | bin | 3490 -> 3490 bytes | |||
-rw-r--r-- | dis/acme/frame.dis | bin | 13561 -> 13561 bytes | |||
-rw-r--r-- | dis/acme/fsys.dis | bin | 9031 -> 9031 bytes | |||
-rw-r--r-- | dis/acme/graph.dis | bin | 633 -> 633 bytes | |||
-rw-r--r-- | dis/acme/gui.dis | bin | 1598 -> 1598 bytes | |||
-rw-r--r-- | dis/acme/look.dis | bin | 9778 -> 9790 bytes | |||
-rw-r--r-- | dis/acme/regx.dis | bin | 11415 -> 11415 bytes | |||
-rw-r--r-- | dis/acme/row.dis | bin | 12127 -> 12133 bytes | |||
-rw-r--r-- | dis/acme/scrl.dis | bin | 1984 -> 1984 bytes | |||
-rw-r--r-- | dis/acme/text.dis | bin | 19148 -> 20063 bytes | |||
-rw-r--r-- | dis/acme/time.dis | bin | 804 -> 804 bytes | |||
-rw-r--r-- | dis/acme/util.dis | bin | 5715 -> 5721 bytes | |||
-rw-r--r-- | dis/acme/wind.dis | bin | 8655 -> 8660 bytes | |||
-rw-r--r-- | dis/acme/xfid.dis | bin | 15877 -> 15900 bytes | |||
-rw-r--r-- | emu/port/alloc.c | 2 | ||||
-rw-r--r-- | libdraw/buildfont.c | 2 |
34 files changed, 64 insertions, 25 deletions
diff --git a/appl/acme/ecmd.b b/appl/acme/ecmd.b index c31643f1..e05c4e47 100644 --- a/appl/acme/ecmd.b +++ b/appl/acme/ecmd.b @@ -772,7 +772,7 @@ nl_cmd(t: ref Text, cp: ref Cmd): int addr = lineaddr(1, a, 1); } } - t.show(addr.r.q0, addr.r.q1); + t.show(addr.r.q0, addr.r.q1, TRUE); return TRUE; } diff --git a/appl/acme/look.b b/appl/acme/look.b index 1004b803..ca288d0a 100644 --- a/appl/acme/look.b +++ b/appl/acme/look.b @@ -273,7 +273,7 @@ search(ct : ref Text, r : string, n : int) : int } if(n <= nb && s.s[b:b+n] == r[0:n]){ if(ct.w != nil){ - ct.show(q, q+n); + ct.show(q, q+n, TRUE); ct.w.settag(); }else{ ct.q0 = q; @@ -698,7 +698,7 @@ openfile(t : ref Text, e : Expand) : (ref Window, Expand) r.q0 = t.q0; r.q1 = t.q1; } - t.show(r.q0, r.q1); + t.show(r.q0, r.q1, TRUE); t.w.settag(); seltext = t; if(e.jump) diff --git a/appl/acme/row.b b/appl/acme/row.b index 478ec930..5e1a3775 100644 --- a/appl/acme/row.b +++ b/appl/acme/row.b @@ -714,7 +714,7 @@ Row.loadx(row : self ref Row, file : string, initing : int) } if(q0>w.body.file.buf.nc || q1>w.body.file.buf.nc || q0>q1) q0 = q1 = 0; - w.body.show(q0, q1); + w.body.show(q0, q1, TRUE); w.maxlines = min(w.body.frame.nlines, max(w.maxlines, w.body.frame.maxlines)); } b.close(); diff --git a/appl/acme/text.b b/appl/acme/text.b index 953a08ea..7fdce3f3 100644 --- a/appl/acme/text.b +++ b/appl/acme/text.b @@ -130,8 +130,10 @@ KF : con 16rF000; Kup : con KF | 16r0E; Kleft : con KF | 16r11; Kright : con KF | 16r12; +Kend : con KF | 16r18; Kdown : con 16r80; + nulltext : Text; newtext() : ref Text @@ -181,7 +183,7 @@ Text.redraw(t : self ref Text, r : Rect, f : ref Draw->Font, b : ref Image, odx if(t.frame.maxlines > 0){ t.reset(); t.columnate(t.w.dlp, t.w.ndl); - t.show(0, 0); + t.show(0, 0, TRUE); } }else{ t.fill(); @@ -703,28 +705,61 @@ Text.typex(t : self ref Text, r : int, echomode : int) } return; Kdown or Keyboard->Down => - n = t.frame.maxlines/2; + n = t.frame.maxlines/3; + q0 = t.org+frcharofpt(t.frame, (t.frame.r.min.x, t.frame.r.min.y+n*t.frame.font.height)); + t.setorigin(q0, FALSE); + return; + Keyboard->Pgdown => + n = 2*t.frame.maxlines/3; q0 = t.org+frcharofpt(t.frame, (t.frame.r.min.x, t.frame.r.min.y+n*t.frame.font.height)); t.setorigin(q0, FALSE); return; Kup or Keyboard->Up => - n = t.frame.maxlines/2; + n = t.frame.maxlines/3; q0 = t.backnl(t.org, n); t.setorigin(q0, FALSE); return; + Keyboard->Pgup => + n = 2*t.frame.maxlines/3; + q0 = t.backnl(t.org, n); + t.setorigin(q0, FALSE); + return; + Keyboard->Home => + t.commit(TRUE); + t.show(0, 0, FALSE); + return; + Kend or Keyboard->End => + t.commit(TRUE); + t.show(t.file.buf.nc, t.file.buf.nc, FALSE); + return; Kleft or Keyboard->Left => t.commit(TRUE); if(t.q0 != t.q1) - t.show(t.q0, t.q0); + t.show(t.q0, t.q0, TRUE); else if(t.q0 != 0) - t.show(t.q0-1, t.q0-1); + t.show(t.q0-1, t.q0-1, TRUE); return; Kright or Keyboard->Right => t.commit(TRUE); if(t.q0 != t.q1) - t.show(t.q1, t.q1); + t.show(t.q1, t.q1, TRUE); else if(t.q1 != t.file.buf.nc) - t.show(t.q1+1, t.q1+1); + t.show(t.q1+1, t.q1+1, TRUE); + return; + 1 => # ^A: beginning of line + t.commit(TRUE); + # go to where ^U would erase, if not already at BOL + nnb = 0; + if(t.q0>0 && t.readc(t.q0-1)!='\n') + nnb = t.bswidth(16r15); + t.show(t.q0-nnb, t.q0-nnb, TRUE); + return; + 5 => # ^E: end of line + t.commit(TRUE); + q0 = t.q0; + while(q0<t.file.buf.nc && t.readc(q0)!='\n') + q0++; + t.show(q0, q0, TRUE); return; } if(t.what == Body){ @@ -737,11 +772,11 @@ Text.typex(t : self ref Text, r : int, echomode : int) exec->cut(t, t, TRUE, TRUE); t.eq0 = ~0; if (r == 16r08 || r == 16r7f){ # erase character : odd if a char then erased - t.show(t.q0, t.q0); + t.show(t.q0, t.q0,TRUE); return; } } - t.show(t.q0, t.q0); + t.show(t.q0, t.q0, TRUE); case(r){ 16r1B => if(t.eq0 != ~0) @@ -1007,17 +1042,21 @@ Text.select(t : self ref Text, double : int) } } -Text.show(t : self ref Text, q0 : int, q1 : int) +Text.show(t : self ref Text, q0 : int, q1 : int, doselect : int) { qe : int; nl : int; q : int; - if(t.what != Body) + if(t.what != Body){ + if(doselect) + t.setselect(q0, q1); return; + } if(t.w!=nil && t.frame.maxlines==0) t.col.grow(t.w, 1, 0); - t.setselect(q0, q1); + if(doselect) + t.setselect(q0, q1); qe = t.org+t.frame.nchars; if(t.org<=q0 && (q0<qe || (q0==qe && qe==t.file.buf.nc+t.ncache))) scrdraw(t); diff --git a/appl/acme/text.m b/appl/acme/text.m index 1c258be3..3343f9b0 100644 --- a/appl/acme/text.m +++ b/appl/acme/text.m @@ -42,7 +42,7 @@ Textm : module { select3 : fn(t : self ref Text, p: int, q : int) : (int, int, int); setselect : fn(t : self ref Text, p : int, q : int); setselect0 : fn(t : self ref Text, p : int, q : int); - show : fn(t : self ref Text, p : int, q : int); + show : fn(t : self ref Text, p : int, q : int, dosel : int); fill : fn(t : self ref Text); commit : fn(t : self ref Text, n : int); setorigin : fn(t : self ref Text, p : int, q : int); diff --git a/appl/acme/util.b b/appl/acme/util.b index b2930c35..3a7acbd2 100644 --- a/appl/acme/util.b +++ b/appl/acme/util.b @@ -536,7 +536,7 @@ warning(md : ref Mntdir, s : string) w.owner = 'E'; w.commit(t); (q0, n) = t.bsinsert(t.file.buf.nc, s, len s, TRUE); - t.show(q0, q0+n); + t.show(q0, q0+n, TRUE); t.w.settag(); scrl->scrdraw(t); w.owner = owner; diff --git a/appl/acme/wind.b b/appl/acme/wind.b index aa4e1950..96b7cb62 100644 --- a/appl/acme/wind.b +++ b/appl/acme/wind.b @@ -267,7 +267,7 @@ Window.undo(w : self ref Window, isundo : int) w.utflastqid = -1; body = w.body; (body.q0, body.q1) = body.file.undo(isundo, body.q0, body.q1); - body.show(body.q0, body.q1); + body.show(body.q0, body.q1, TRUE); f = body.file; for(i=0; i<f.ntext; i++){ v = f.text[i].w; diff --git a/appl/acme/xfid.b b/appl/acme/xfid.b index 85d9da9f..52a46193 100644 --- a/appl/acme/xfid.b +++ b/appl/acme/xfid.b @@ -321,7 +321,7 @@ Xfid.close(x : self ref Xfid) t :=w.body; # before: only did this if !w->noscroll, but that didn't seem right in practice t.show(min(w.wrselrange.q0, t.file.buf.nc), - min(w.wrselrange.q1, t.file.buf.nc)); + min(w.wrselrange.q1, t.file.buf.nc), TRUE); scrdraw(t); QWconsctl=> w.echomode = EM_NORMAL; @@ -535,7 +535,7 @@ Xfid.write(x : self ref Xfid) if(tq1 >= q0) tq1 += nr; if(!t.w.noscroll) - t.show(tq0, tq1); + t.show(tq0, tq1, TRUE); scrdraw(t); w.settag(); r = nil; @@ -586,7 +586,7 @@ Xfid.write(x : self ref Xfid) } (q0, nr) = t.bsinsert(q0, r, nr, TRUE); if(qid!=QWwrsel && !t.w.noscroll) - t.show(q0+nr, q0+nr); + t.show(q0+nr, q0+nr, TRUE); scrdraw(t); }else t.insert(q0, r, nr, TRUE, 0); @@ -642,7 +642,7 @@ loop : }else if(strncmp(p, "show", 4) == 0){ # show dot t = w.body; - t.show(t.q0, t.q1); + t.show(t.q0, t.q1, TRUE); m = 4; }else if(strncmp(p, "name ", 5) == 0){ # set file name diff --git a/dis/acme.dis b/dis/acme.dis Binary files differindex 2695ae4b..1cecd618 100644 --- a/dis/acme.dis +++ b/dis/acme.dis diff --git a/dis/acme/acme.dis b/dis/acme/acme.dis Binary files differindex 2695ae4b..1cecd618 100644 --- a/dis/acme/acme.dis +++ b/dis/acme/acme.dis diff --git a/dis/acme/buff.dis b/dis/acme/buff.dis Binary files differindex ab4080fa..b0ce8cd2 100644 --- a/dis/acme/buff.dis +++ b/dis/acme/buff.dis diff --git a/dis/acme/col.dis b/dis/acme/col.dis Binary files differindex 13095a98..aa5ef7a9 100644 --- a/dis/acme/col.dis +++ b/dis/acme/col.dis diff --git a/dis/acme/dat.dis b/dis/acme/dat.dis Binary files differindex 20c9d895..364d37cc 100644 --- a/dis/acme/dat.dis +++ b/dis/acme/dat.dis diff --git a/dis/acme/disk.dis b/dis/acme/disk.dis Binary files differindex a68f0c29..a31cc952 100644 --- a/dis/acme/disk.dis +++ b/dis/acme/disk.dis diff --git a/dis/acme/ecmd.dis b/dis/acme/ecmd.dis Binary files differindex 1285f17f..5794e5b3 100644 --- a/dis/acme/ecmd.dis +++ b/dis/acme/ecmd.dis diff --git a/dis/acme/edit.dis b/dis/acme/edit.dis Binary files differindex 5fbd24da..e412bf02 100644 --- a/dis/acme/edit.dis +++ b/dis/acme/edit.dis diff --git a/dis/acme/elog.dis b/dis/acme/elog.dis Binary files differindex cc7ef681..dee3acd3 100644 --- a/dis/acme/elog.dis +++ b/dis/acme/elog.dis diff --git a/dis/acme/exec.dis b/dis/acme/exec.dis Binary files differindex a9e17a78..a7f39e1a 100644 --- a/dis/acme/exec.dis +++ b/dis/acme/exec.dis diff --git a/dis/acme/file.dis b/dis/acme/file.dis Binary files differindex 5658d5b7..62e7367b 100644 --- a/dis/acme/file.dis +++ b/dis/acme/file.dis diff --git a/dis/acme/frame.dis b/dis/acme/frame.dis Binary files differindex 5f786c4e..2582f867 100644 --- a/dis/acme/frame.dis +++ b/dis/acme/frame.dis diff --git a/dis/acme/fsys.dis b/dis/acme/fsys.dis Binary files differindex a7513375..4ccfdaae 100644 --- a/dis/acme/fsys.dis +++ b/dis/acme/fsys.dis diff --git a/dis/acme/graph.dis b/dis/acme/graph.dis Binary files differindex af56722c..87949cee 100644 --- a/dis/acme/graph.dis +++ b/dis/acme/graph.dis diff --git a/dis/acme/gui.dis b/dis/acme/gui.dis Binary files differindex 04288ef5..90535d6f 100644 --- a/dis/acme/gui.dis +++ b/dis/acme/gui.dis diff --git a/dis/acme/look.dis b/dis/acme/look.dis Binary files differindex 7a820e42..1d03b1fd 100644 --- a/dis/acme/look.dis +++ b/dis/acme/look.dis diff --git a/dis/acme/regx.dis b/dis/acme/regx.dis Binary files differindex 3d10e557..88e990c8 100644 --- a/dis/acme/regx.dis +++ b/dis/acme/regx.dis diff --git a/dis/acme/row.dis b/dis/acme/row.dis Binary files differindex b5165023..5ec6dd27 100644 --- a/dis/acme/row.dis +++ b/dis/acme/row.dis diff --git a/dis/acme/scrl.dis b/dis/acme/scrl.dis Binary files differindex 121dfdc2..8f2c2ef2 100644 --- a/dis/acme/scrl.dis +++ b/dis/acme/scrl.dis diff --git a/dis/acme/text.dis b/dis/acme/text.dis Binary files differindex 750cd219..2054aa8f 100644 --- a/dis/acme/text.dis +++ b/dis/acme/text.dis diff --git a/dis/acme/time.dis b/dis/acme/time.dis Binary files differindex f422b832..dce289a1 100644 --- a/dis/acme/time.dis +++ b/dis/acme/time.dis diff --git a/dis/acme/util.dis b/dis/acme/util.dis Binary files differindex bb157a1a..4fedf6b5 100644 --- a/dis/acme/util.dis +++ b/dis/acme/util.dis diff --git a/dis/acme/wind.dis b/dis/acme/wind.dis Binary files differindex aa744258..aacb6c4b 100644 --- a/dis/acme/wind.dis +++ b/dis/acme/wind.dis diff --git a/dis/acme/xfid.dis b/dis/acme/xfid.dis Binary files differindex f02bd302..35c96111 100644 --- a/dis/acme/xfid.dis +++ b/dis/acme/xfid.dis diff --git a/emu/port/alloc.c b/emu/port/alloc.c index e2206c3f..333f4fa3 100644 --- a/emu/port/alloc.c +++ b/emu/port/alloc.c @@ -50,7 +50,7 @@ struct { { "main", 0, 32*1024*1024, 31, 512*1024, 0, 31*1024*1024 }, { "heap", 1, 32*1024*1024, 31, 512*1024, 0, 31*1024*1024 }, - { "image", 2, 32*1024*1024+256, 31, 4*1024*1024, 1, 31*1024*1024 }, + { "image", 2, 64*1024*1024+256, 31, 4*1024*1024, 1, 63*1024*1024 }, } }; diff --git a/libdraw/buildfont.c b/libdraw/buildfont.c index f86fdc81..ef861a8d 100644 --- a/libdraw/buildfont.c +++ b/libdraw/buildfont.c @@ -70,7 +70,7 @@ buildfont(Display *d, char *buf, char *name) } max = strtol(s, &s, 0); s = skip(s); - if(*s==0 || min>=65536 || max>=65536 || min>max){ + if(*s==0 || min>=Runemax || max>=Runemax || min>max){ kwerrstr("illegal subfont range"); Err3: freefont(fnt); |