Skip to content

Concurrent v0.5.5 -> v0.6.7 #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 75 commits into from
May 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a0ff121
save work
as Feb 12, 2018
aace88c
remove event driven event pumps
as Feb 14, 2018
6921516
a: integrate with concurrent shiny
as Feb 25, 2018
cff92fa
a: improve frame rate limiting for external paint events
as Feb 26, 2018
a9e1912
a: add fs implementation
as Feb 28, 2018
e41d6ec
a: remove print statements
as Feb 28, 2018
f4010f1
a: fix tag colors
as Feb 28, 2018
5fe62b3
a: add fs client tests and server tests
as Mar 1, 2018
6bd3cbb
a: fix bug in break statement, change to return
as Mar 1, 2018
d2e6f2d
a: fs: add remote fs
as Mar 4, 2018
17ea8d0
a: add remove client options
as Mar 4, 2018
720518d
a: remote functionality
as Mar 5, 2018
152c902
a: fix lifecylce.StageDead logic
as Mar 5, 2018
3f28ecb
a: implement -q for headless operation
as Mar 5, 2018
92e2c61
.
as Mar 13, 2018
1ce79e4
a: major refactor for loop and mouse processing. convert everything t…
as Mar 16, 2018
2f3ff76
a: clean up main a bit; remove more event-driven functions and replac…
as Mar 24, 2018
36baf19
a: save current work
as Mar 25, 2018
afe36e6
a: v0.6.0: csp
as Mar 25, 2018
5582307
a: re-implement mouse(3) in sizer
as Mar 28, 2018
f0941f5
a: concurrent mouse and keyboard
as Mar 29, 2018
8687565
v0.6.1: clean up main
as Apr 3, 2018
bbcba97
a: dont look at zero length filenames
as Apr 5, 2018
5bec87c
a: check for nil body
as Apr 5, 2018
fa5fdf2
a: dont highlight error log; dont crash on nil window
as Apr 5, 2018
c84024a
a: fix cmd readers to always process n bytes if n > 0
as Apr 5, 2018
eba573f
a: gofmt -s
as Apr 5, 2018
f5f81d8
a: remove mouse handling from main
as Apr 7, 2018
791352c
a: remove useless tag
as Apr 8, 2018
653caf3
a: remove canary panic
as Apr 8, 2018
61f33e3
a: paste shouldnt break selection
as Apr 8, 2018
8224b50
a: make click in sizer work again
as Apr 8, 2018
29dad3a
a: rename unthrottled to throttled (drop the negation)
as Apr 8, 2018
0a02193
a: fix bug where error window spawns twice
as Apr 8, 2018
7a021b6
a: look inside directories even whent the file doesn't exist
as Apr 8, 2018
44ebdb2
a: fix error window lookups
as Apr 8, 2018
83a2cfc
a: create a proof of concept plumber
as Apr 9, 2018
882f562
a: tag: make window an interface; add image experiment
as Apr 9, 2018
b179d57
a: fix edit
as Apr 9, 2018
f4cb908
a: fix scroll
as Apr 10, 2018
6215e9e
a: fix mouse issues re: movement
as Apr 11, 2018
fd0428f
a: never make button 2 create a selection
as Apr 11, 2018
d53b2a6
a: improve right click behavior
as Apr 16, 2018
3c72e14
a: major refactor
as Apr 24, 2018
b02960c
a: more seperation of grid, col, and generic table structures
as Apr 26, 2018
eb2938f
a: stablize grid
as Apr 27, 2018
fb33943
a: border: allow entire grid to be moved
as Apr 28, 2018
8a5f532
a: remove crazy dependencies and new helpers that do too much, too early
as Apr 28, 2018
7402cd9
a: layout.go -> draw.go sounds better
as Apr 28, 2018
5e388c7
col: fix drag crasher
as Apr 30, 2018
f8d9860
cmd: edit: better handle running of command
as Apr 30, 2018
6e30ad3
gofmt -s
as Apr 30, 2018
b394d28
a: make new windows spawn underneath text in partially full windows
as Apr 30, 2018
4e57684
a: guru: fix command that reads the selection of a grid tag
as Apr 30, 2018
8716b6b
a: remove print statements
as Apr 30, 2018
dbc3452
gofmt -s
as Apr 30, 2018
48cd6dc
a: make col create the tagline
as Apr 30, 2018
13dc927
a: fix after downstream change in upload semantics
as Apr 30, 2018
beed3d4
a: dont know how acme does it, but make a new window consume either a…
as Apr 30, 2018
5f120cf
a: add kbd handling here
as Apr 30, 2018
794cd05
a: remove actTag.Kbd call
as May 1, 2018
0e71b50
a: darwin: add platform specific workaround for mouse move function
as May 3, 2018
91ac304
a: darwin: additional mouse fix
as May 3, 2018
23d174b
v0.6.6
as May 3, 2018
df633bd
v0.6.7: fix path handling
as May 5, 2018
6ff0c6e
v0.6.7: change event cap
as May 5, 2018
44fc3a4
a: add go.mod
as May 5, 2018
cacf9c2
removes print statement from border
as May 5, 2018
ced4625
removes print statement from border
as May 5, 2018
0f1f797
Merge branch 'concurrent' of github.com:/as/a into concurrent
as May 5, 2018
e582769
a: make it easier to set the scroll colors - fix -b
as May 5, 2018
c10969a
a: fix guru and selection
as May 5, 2018
9f2a99a
a: fix elastic tabstops and utf (another todo is that it crashes)
as May 5, 2018
e493d3f
a: fix readme and remove some comments
as May 5, 2018
28fe6c3
Merge branch 'master' into concurrent
as May 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ https://github.com/as/a/wiki/Alterations
https://github.com/as/a/issues

# hints
To reshape the windows and columns, click on the invisible 10x10px sizer that I haven't rendered yet with the middle mouse button. Hold the button down and move the window to the location. Release the button.
To reshape the windows and columns, click on the invisible 10x10px sizer that I haven't rendered yet with the left mouse button.
Hold the button down and move the window to the location.
Release the button.

# edit
- 80% of the sam command language is implemented.
Expand Down Expand Up @@ -83,10 +85,6 @@ Edit ,x,the standard editor is any editor,x,any editor,c,ed,
- Looking (right click) in the main tag finds the result in all open windows
![paint](jump.png)

# purpose
- ACME SAC doesn't run on my computer
- The solution is to create a text editor from scratch then

# future
- Fixing the bugs
- Cleaning the code up
Expand Down
30 changes: 0 additions & 30 deletions a.go
Original file line number Diff line number Diff line change
@@ -1,31 +1 @@
package main

import (
"github.com/as/edit"
"github.com/as/frame"
)

func (g *Grid) acolor(e edit.File) {
// TODO(as): O(n*m) -> O(1)
if t := g.FindName(e.Name); t != nil {
if t.Body == nil {
return
}
fr := t.Body.Frame
p0, p1 := e.Q0, e.Q1
p0 -= clamp(p0-t.Body.Origin(), 0, fr.Len())
p1 -= clamp(p1-t.Body.Origin(), 0, fr.Len())
fr.Recolor(fr.PointOf(p0), p0, p1, frame.Mono.Palette)
fr.Mark()
}
}

func clamp(v, l, h int64) int64 {
if v < l {
return l
}
if v > h {
return h
}
return v
}
55 changes: 26 additions & 29 deletions active.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ import (
"image"

"github.com/as/ui/tag"
"github.com/as/ui/win"
)

var (
actCol *Col
actTag *tag.Tag
act *win.Win
act tag.Window
)

func actinit(g *Grid) {
// This in particular needs to go
actCol = g.List[0].(*Col)
actTag = actCol.List[0].(*tag.Tag)
act = actTag.Body
}

func active2(pt image.Point, list ...Plane) (x Plane) {
for i, w := range list {
if w == nil {
Expand All @@ -26,36 +32,29 @@ func active2(pt image.Point, list ...Plane) (x Plane) {
return nil
}

// Put
func active(pt image.Point, act Plane, list ...Plane) (x Plane) {
if tag.Buttonsdown != 0 {
return act
func activelabel(pt image.Point, t *tag.Tag) bool {
if t.Win == nil {
panic("FLAG: label is nil")
}
if act != nil {
list = append([]Plane{act}, list...)
}
for i, w := range list {
if w == nil {
continue
}
r := w.Loc()
if pt.In(r) {
return list[i]
}
if pt.In(t.Win.Loc()) {
actTag = t
act = t.Win
return true
}
return act
return false
}

func activate(pt image.Point, w Plane) {
if tag.Buttonsdown != 0 {
return
}
switch w := w.(type) {
case *Grid:
if activelabel(pt, w.Tag) {
return
}
x := active2(pt, w.List...)
switch x := x.(type) {
case *tag.Tag:
actCol = w.Col
panic("tag not allowed in column anymore")
//actCol = w.Col
actTag = x
act = x.Win
case *Col:
Expand All @@ -65,19 +64,17 @@ func activate(pt image.Point, w Plane) {
}
case *Col:
actCol = w
x := active2(pt, w.List...)
if eq(x, w.List[0]) {
actTag = x.(*tag.Tag)
act = x.(*tag.Tag).Win
} else {
activate(pt, x)
if activelabel(pt, w.Tag) {
return
}
x := active2(pt, w.List...)
activate(pt, x)
case *tag.Tag:
actTag = w
if w.Body != nil {
activate(pt, active2(pt, w.Body, w.Win))
}
case *win.Win:
case tag.Window:
act = w
}
}
13 changes: 13 additions & 0 deletions args.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import "flag"

func argparse() (list []string) {
if len(flag.Args()) > 0 {
list = append(list, flag.Args()...)
} else {
list = append(list, "guide")
list = append(list, ".")
}
return
}
61 changes: 61 additions & 0 deletions assert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package main

import (
"image"
"log"

"github.com/as/ui/tag"
)

const debug = 1 ^ 1

func assert(where string, g *Grid) {
if debug == 0 {
return
}
log.Printf("%s: grid %s\n", where, g.Loc())
for i, c := range g.List {
for j, c2 := range g.List {
if c == c2 {
continue
}
if c.Loc().Intersect(c2.Loc()) != image.ZR {
log.Printf("%s: col %v %s intersects col %v %s\n", where, i, c.Loc(), j, c2.Loc())
panic("suicide")
}
}
}
if g.Tag.Vis != tag.VisTag {
log.Printf("%v\n", g.Tag.Vis)
// panic("grid tag not vistag") // Put
}
for i, c := range g.List {
if c.(*Col).Tag.Vis != tag.VisTag {
log.Printf("number %d = %v\n", i, g.Tag.Vis)
//panic("col tag not vistag")
}
if !c.Loc().In(g.Loc()) {
log.Printf("%s: col %v %s not in grid %s\n", where, i, c.Loc(), g.Loc())
// panic("suicide")
}
log.Printf("%s: col %v %s is good\n", where, i, c.Loc())
{
c, _ := c.(*Col)
if c == nil {
continue
}
for j, t := range c.List {
if !t.Loc().In(c.Loc()) {
log.Printf("%s: tag %v %s not in col %v %s\n", where, j, t.Loc(), i, c.Loc())
//panic("suicide")
}
if !t.Loc().In(g.Loc()) {
log.Printf("%s: tag %v %s not in grid %v %s\n", where, j, t.Loc(), i, g.Loc())
//panic("suicide")

}
log.Printf("%s: tag %v %s is good\n", where, j, t.Loc())
}
}
}
}
69 changes: 69 additions & 0 deletions border.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package main

import (
mus "github.com/as/text/mouse"
"github.com/as/ui/col"
"github.com/as/ui/win"
"golang.org/x/mobile/event/mouse"
)

func borderHit(e mouse.Event) bool {
pt := p(e)
return inSizer(pt) || inScroll(pt)
}

func procBorderHit(e mouse.Event) {
apt := p(e)
e = rel(e, act)
pt := p(e)

switch {
case inSizer(pt):
if HasButton(1, down) {
if !apt.In(g.Area()) {
for down != 0 {
g.Move(apt)
g.Refresh()
col.Fill(g)
apt = p(readmouse(<-D.Mouse))
}
} else if canopy(apt) {
dragCol(g, actCol, e, D.Mouse)
} else {
dragTag(actCol, actTag, e, D.Mouse)
}
break
}
switch down {
case Button(2):
case Button(3):
// actCol.PrintList()
actCol.RollUp(actCol.ID(actTag), act.Loc().Min.Y)
// actCol.PrintList()
moveMouse(act.Loc().Min)
}
for down != 0 {
readmouse(<-D.Mouse)
}
case inScroll(pt):
switch down {
case Button(1):
scroll(act, mus.ScrollEvent{Dy: 10, Event: e})
case Button(2):
w, _ := act.(*win.Win)
if w == nil {
break
}
w.Clicksb(pt, 0)
repaint()
for HasButton(2, down) {
w.Clicksb(p(rel(readmouse(<-D.Mouse), w)), 0)
repaint()
}
case Button(3):
scroll(act, mus.ScrollEvent{Dy: -10, Event: e})
}
default:
logf("unknown border action at pt: %s", pt)
}
}
Loading