You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It wasn't obvious to me (at first) what the b edit command was actually for until I read the code. It sets the target Text instance for the subsequent sequence of sam commands inside a single exec of Edit. For example, have a convenient scratch buffer with something like this:
Edit
b <already loaded filename with more than 3 lines>
1 a/hello/
2 a/there/
So I got excited about this and thought "ah ha!", made myself a scratch buffer and wrote a bunch of sam commands to edit some code and middle clicked the whole thing. Edwood promptly crashed:
panic: Changes not in order
goroutine 23 [running]:
main.(*Elog).Insert(0xc00014e148, 0x35, 0xc000383e40, 0x3, 0x20)
/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/elog.go:151 +0x474
main.appendx(0xc00014e100, 0xc0000c0140, 0x35, 0x124ad48)
/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/ecmd.go:655 +0xdc
main.i_cmd(0xc00036a518, 0xc0000c0140, 0x7b)
/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/ecmd.go:297 +0x45
main.cmdexec(0xc00036a518, 0xc0000c0140, 0xc0000c0140)
/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/ecmd.go:109 +0x3a2
main.editthread(0xc00029f440)
/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/edit.go:153 +0xbd
created by main.editcmd
/Users/rjkroege/tools/gopkg/src/github.com/rjkroege/edwood/edit.go:221 +0x1d5
testedwood.sh : exit status 2
While the above example would work, this slightly different example below replicates the out-of-order crash.
Edit
b <already loaded filename with more than 3 lines>
2 a/there/
1 a/hello/
So there are several distinct issues here that I'd like to fix:
user input to Edit should never bring down Edwood
sam would treat each of these commands as separate and apply them. If they were enclosed in { }, then sam would (silently) ignore out-of-order commands. I think Edwood should warn and ignore in that case.
The text was updated successfully, but these errors were encountered:
It wasn't obvious to me (at first) what the
b
edit command was actually for until I read the code. It sets the targetText
instance for the subsequent sequence of sam commands inside a single exec of Edit. For example, have a convenient scratch buffer with something like this:So I got excited about this and thought "ah ha!", made myself a scratch buffer and wrote a bunch of sam commands to edit some code and middle clicked the whole thing. Edwood promptly crashed:
While the above example would work, this slightly different example below replicates the out-of-order crash.
So there are several distinct issues here that I'd like to fix:
{ }
, then sam would (silently) ignore out-of-order commands. I think Edwood should warn and ignore in that case.The text was updated successfully, but these errors were encountered: