Giter Site home page Giter Site logo

edwood's Introduction

Go Report CardBuild Status

Overview

Go port of Rob Pike's Acme editor. Derived from ProjectSerenity but now increasingly divergent. ProjectSerenity was itself a transliteration of the original Acme and libframe C code from plan9port

Named edwood in celebration of the formative influence of Ed Wood on Plan9 and the truth of ed-iting.

Note that on unix systems, Edwood (as with Acme) requires by default some infrastructure from plan9port: in particular devdraw, 9pserve and fontsrv. (Note that many other utilities like win and 9pfuse that contribute to Edwood's utility are also found in plan9port.) So, you'll want to install plan9port first, unless you choose to use the more experimental pure-Go Edwood described below.

Edwood without plan9port

On Windows, plan9port is never used. On unix systems, plan9port is not used only when the duitdraw and mux9p tags are used:

go get -u -tags 'duitdraw mux9p' github.com/rjkroege/edwood

These tags replaces devdraw with duitdraw and 9pserve with mux9p. Note that there are several outstanding issues which makes Edwood more unstable and slower when not using plan9port.

Duitdraw can use TTF fonts or compressed Plan 9 bitmap fonts. If the font name is empty, the Go Font is used. Example usage:

edwood	# Use Go font at 10pt
edwood -f @12pt -F @12pt	# Go font at 12pt
edwood -f /usr/share/fonts/TTF/DejaVuSans.ttf@12pt -F /usr/share/fonts/TTF/DejaVuSansMono.ttf@12pt
edwood -f $PLAN9/font/lucsans/euro.8.font -F $PLAN9/font/lucm/unicode.9.font

Edwood on Plan 9

To build Edwood on Plan 9, use 9fans.net/go PR#28:

hget https://github.com/rjkroege/edwood/archive/master.tar.gz | tar xvz
cd edwood-master
go mod edit -replace '9fans.net/go=github.com/fhs/9fans-go@plan9-pr'
go build
./edwood

Contributions

Contributions are welcome. Just submit a pull request and we'll review the code before merging it in.

Discussion

Have thoughts? Questions? Want to talk about Edwood (or Acme and other related Plan9 things)? If so, I've now enabled Edwood GitHub Discussions.

Project Status

Edwood has reached the useful milestone (v0.1) and should serve as drop-in replacement for Plan9 Port Acme. (But probably with different bugs.) Please file issues if Acme client apps don't work with Edwood or if your favourite Acme feature doesn't work.

Roadmap

  • More idiomatic Go and tests.
  • Internal API modernization.
  • Revised text handling data structures.
  • More configurability: styles, keyboard shortcuts, autocomplete.
  • See the issues list for the details.
  • Improve the testing code coverage

edwood's People

Contributors

camsn0w avatar dependabot[bot] avatar dnjp avatar fhs avatar fluxlalonde avatar knusbaum avatar paul-lalonde avatar rjkroege avatar rminnich avatar sfyatee avatar stringy avatar uluyol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edwood's Issues

crash while deleting text at end of text

oops.

panic: runtime error: index out of range

goroutine 11 [running]:
github.com/rjkroege/edwood/frame.(*Frame).Delete(0xc4201a4fc0, 0x237, 0x238, 0x5d4)
	/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/frame/delete.go:51 +0xdd2
main.(*Text).Delete(0xc420477d20, 0x237, 0x238, 0x0)
	/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:608 +0x3a8
main.(*Text).Type(0xc420477d20, 0xc400000008)
	/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:942 +0x8bb
main.(*Window).Type(0xc420477c00, 0xc420477d20, 0x8)
	/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/wind.go:392 +0x37
main.(*Row).Type(0x12cde00, 0x8, 0x256, 0x3b6, 0x1)
	/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/row.go:277 +0x139
main.keyboardthread(0xc4200ce0c0)
	/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:456 +0x274
created by main.main
	/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:181 +0x907

Note to self... Hit Put way more frequently.

External Custom Selection

Acme/Edwood (#46) have some complicated code to make double-clicking useful in HTML files. This doesn't really fit the Acme philosophy. We should consider a mechanism to make it possible to write an external command to customize double clicking.

B command doesn't open a file

The B command failed to open anything.

Console output (possibly suspect) at roughly the same time:

9pserve: announce unix!/tmp/ns.rjkroege.:0/acme: Address already in use
acme: can't post service: 9pserve failed

Yet more frame frailty

Frame has some bugs. Make it more robust.

Untested: main.plumbthread(): /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/look.go:48 +0x204
Got a message: &{B edit /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood text 0xc4204de2a0 [47 85 115 101 114 115 47 114 106 107 114 111 101 103 101 47 116 111 111 108 115 47 103 111 112 107 103 47 115 114 99 47 103 105 116 104 117 98 46 99 111 109 47 114 106 107 114 111 101 103 101 47 101 100 119 111 111 100 47 46 103 105 116 47 67 79 77 77 73 84 95 69 68 73 84 77 83 71]}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1139453]
goroutine 7 [running, locked to thread]:
github.com/rjkroege/edwood/frame.nrune(...)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/frame/util.go:144
github.com/rjkroege/edwood/frame.(*Frame).strlen(0x12d8ac0, 0x1, 0x13e)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/frame/draw.go:278 +0x43
github.com/rjkroege/edwood/frame.(*Frame)._draw(0x12d8ac0, 0x4ed, 0x13e, 0xc4204de300, 0x4ed)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/frame/draw.go:248 +0x1f0
github.com/rjkroege/edwood/frame.(*Frame).bxscan(0xc420338d80, 0xc420200000, 0x5f, 0x5f, 0xc4202b97f0, 0x0, 0xc4202b9740)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/frame/insert.go:104 +0x88e
github.com/rjkroege/edwood/frame.(*Frame).Insert(0xc420338d80, 0xc420200000, 0x5f, 0x5f, 0x0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/frame/insert.go:165 +0x16c
main.(*Text).Fill(0xc4202c8418)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:545 +0xc0
main.(*Text).Redraw(0xc4202c8418, 0x4ed, 0x122, 0x800, 0x15a, 0xc420188000, 0xc4200c48c0, 0x334)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:143 +0x268
main.(*Text).Resize(0xc4202c8418, 0x4ed, 0x122, 0x800, 0x15a, 0x1, 0x5d4)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:165 +0x1c0
main.(*Window).Resize(0xc4202c8400, 0x4cc, 0x122, 0x800, 0x2e4, 0xc420160000, 0x0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/wind.go:254 +0x549
main.(*Column).Add(0xc420001800, 0x0, 0x0, 0xffffffffffffffff, 0x1)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/col.go:140 +0x45c
main.makenewwindow(0x0, 0x4e)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/util.go:225 +0x2b6
main.openfile(0x0, 0xc4201628c0, 0x4)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/look.go:765 +0x8b
main.plumblook(0xc4200b2ae0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/look.go:248 +0x121
main.mousethread(0xc4200ce0c0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:291 +0x310
created by main.main
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:168 +0x8a1

missing Dump command

Dump doesn't work. And it would be convenient to have it (and have it happen regularly) given the current reliability of Edwood.

Tag addition

I have a script that adds some tag contents when I create a certain kind of file. The first string is not space separated from the default tag contents in Edwood vs Acme.

HTML link selections

Currently Edwood doesn't support the HTML selection constructs that Acme offers. This is inconvenient while editing HTML.

filesystem fragility

I attempted:

9p read acme/3/body | head

where I believed that window 3 contained more than sufficient text and got this:

goroutine 66 [running]:
main.xfidutfread(0xc4203c4000, 0xc420468128, 0xda9, 0xb)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/xfid.go:902 +0x3f5
main.xfidread(0xc4203c4000)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/xfid.go:332 +0x30a
main.xfidctl(0xc4203c4000, 0xc4200ac0c0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/xfid.go:46 +0x87
created by main.xfidallocthread
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:616 +0x1e5

Invalid Font arg locks the UI

Attempt to activate an invalid Font (say by providing an argument to the Font command) and the UI will become permanently non-responsive.

selection bug in text.go

On double-clicking and not a Frame issue. ๐Ÿ˜Š

Text.Select: DoubleClick returned 27783, 0
panic: acme: textsetselect p0=518 p1=0 q0=27783 q1=0 t.org=27265 nchars=1134
goroutine 11 [running, locked to thread]:
main.(*Text).SetSelect(0xc420458528, 0x6c87, 0x0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:1303 +0x352
main.(*Text).Select(0xc420458528)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:1118 +0x670
main.MovedMouse(0x4c6, 0x241, 0x1, 0x2b2ef9bc)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:418 +0x4fb
main.mousethread(0xc4200b60c0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:297 +0x31c
created by main.main
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:171 +0x934

" operator crashes Edwood

I created a win session. I typed some commands. I used the " shell command by itself. (Which shouldn't have worked properly but never mind that.) Edwood promptly crashed:

panic: runtime error: slice bounds out of range
goroutine 50 [running]:
main.xfidutfread(0xc420394000, 0xc420382128, 0xc40, 0xb)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/xfid.go:901 +0x3f8
main.xfidread(0xc420394000)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/xfid.go:332 +0x30a
main.xfidctl(0xc420394000, 0xc4200b60c0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/xfid.go:46 +0x87
created by main.xfidallocthread
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:628 +0x1e5

Crash when double-clicking

Double clicking caused this crash. The offsets seem suspicious.

Text.Select: DoubleClick returned 3067, 3075
panic: acme: textsetselect p0=903 p1=0 q0=3081 q1=0 t.org=0 nchars=903
goroutine 35 [running, locked to thread]:
main.(*Text).SetSelect(0xc4201aad28, 0xc09, 0x0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:1308 +0x352
main.(*Text).Select(0xc4201aad28)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/text.go:1195 +0x4cc
main.MovedMouse(0x104, 0x1a2, 0x1, 0xa56f001d)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:418 +0x4fb
main.mousethread(0xc4200b60c0)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:297 +0x31c
created by main.main
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/acme.go:171 +0x934

paste to display: runes vs bytes

Somewhere in the code stack between pasting a string and its display, there is a confusion about number of runes vs number of bytes.

Replication: paste a string containing a multi-byte UTF8 rune repeatedly. Eventually see incorrect display updates. Contents of Text would appear to be correct as scrolling will fix the issue. I blame frame.

lock sadness

I middle click on go build in the tag of a .../edwood and got the following sadness:

The full stack trace was very long. We leak go routines in exec somewhere...

Untested: main.execute(0xc420045c18, 0x59, 0x59, 0x0, 0x0): /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/exec.go:121 +0x37
q1 == q0
selection chosen
Full path is /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood
Untested: main.run(0xc420045c00, 0xc420210110, 0xa, 0xc42046fa40, 0x3a, 0x1, 0x0, 0x0, 0x0, 0x0, ...): /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/exec.go:637 +0x34
fatal error: sync: unlock of unlocked mutex
goroutine 22 [running]:
runtime.throw(0x11e484c, 0x1e)
        /usr/local/Cellar/go/1.10.1/libexec/src/runtime/panic.go:616 +0x81 fp=0xc420054e90 sp=0xc420054e70 pc=0x102a0f1
sync.throw(0x11e484c, 0x1e)
        /usr/local/Cellar/go/1.10.1/libexec/src/runtime/panic.go:605 +0x35 fp=0xc420054eb0 sp=0xc420054e90 pc=0x102a065
sync.(*Mutex).Unlock(0x12dc220)
        /usr/local/Cellar/go/1.10.1/libexec/src/sync/mutex.go:184 +0xc2 fp=0xc420054ed8 sp=0xc420054eb0 pc=0x10680d2
main.fsysdelid(0xc4202ba180)
        /Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/fsys.go:191 +0x1b2 fp=0xc420054f40 sp=0xc420054ed8 pc=0x1157002
...

|cmd execution doesn't work multiple times

The first time that I middle-executed |fmt on a selection, all was well. The second and subsequent times, the selection was deleted and the stdout of fmt was dropped on the floor with the following warning:

Failed to open 4/rdsel: already in use

use box cursor

I miss the box cursor while dragging windows. Add this.

Xerox Locks up

Xerox locks the main thread

  • Click in a window body text
  • Zerox

Kapow! The UI stops responding

can't select from top corner of some Text(s)

I couldn't select starting from any rune on the first line in a Text. I presume that I am incorrectly computing the target rune from the mouse position. Investigate Ptofchar implementation. In particular: notion is to validate that the box model aligns correctly with the containing Frame rectangle.

Edit still working oddly?

I keep on trying things with Edit and being surprised compared to Acme.

  • Edit x/^/ i://: to comment out a selection. Or not? I must have misunderstood.
  • Edit x://: d to remove the comments? ssam did the right thing with this command with the exception of inserting 4 invalid rune characters at the end of the selection. (Is that Edwood or ssam? Edwood also left the selection in a bad state for which we can see #30.
  • Edit ,x/\(image\.Point, image\.Point\)/ c/(image.Point, image.Point, *Frame)/ did something odd. ssam worked as expected (except for more invalid runes at the end of the buffer.)

@fluxlalonde: I thought that you had fixed the first one?

win locks

in Acme, win would regularly lock up in some fashion. Like 1/week.

In Edwood, win also regularly locks up. It just does it a lot more frequently: like every few commands.

Command outputs all go to /+Errors

Instead of to their proper directory +Errors. pwd in two different windows yielded
/Users/plalonde/dev/src/github.com/rjkroege/edwood
/Users/plalonde/dev/src/github.com/9fans/go/draw
both in /+Errors

warp cursor

mouse pointer needs to be warped on MacOS 10.13.4. Maybe this is actually a devdraw issue.

Frame is brittle

Something in win's setup is causing frame to freak out. I think it's fr.Deleting a tag that has not yet been fr.Inserted, leading to bounds errors in box handling and messing up Nchars and Nlines. And panics. So many panics.
Frame probably wants to be robust to incorrect usage ;-)

External autocomplete

Acme has a built-in simple autocomplete system that Edwood has inherited. The inclusion of this functionality isn't necessarily compatible with the Acme "IDE built of UNIX commands" model. We should consider implementing a scheme where an external command (perhaps configurable per Window) would be responsible for autocompletion functionality.

relocating a Window between columns redraws strangely

I drag (well, move I suppose) a Window from a larger to smaller column and it

  • doesn't draw right in the new smaller column at first. (Indented lines were missing?)
  • but (here's the odd part) the area in the original column became a "zombie" Window (the Window was relocated to the smaller column)
  • resizing fixed all

Add a Load command

Not much point writing a Dump command unless there's a way to load the result back.

Vendoring

Implement vendoring per rsc's scheme. Note that this will require building with vgo.

Why vendor: largely so that we can reuse / modify other packages. Like 9fans.net/go in particular. But we might want to use some other packages as we extend/augment edwood.

personal keybindings

I need to add back the keybindings that I've hacked into my own fork of p9p acme in a way that multiple different bindings can exist in the same binary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.