Age | Commit message (Collapse) | Author | Files | Lines |
|
The only difference from the upscaled 16x16
is a one-pixel adjustment in the offset position,
but this at least exercises setcursor2.
|
|
To reproduce, create a column with at least two windows and resize
acme to have almost zero height.
|
|
When plumbing an address like `3-`, Acme selects line 1,
and similarly `3+` selects line 5.
The same problem can be observed for character addresses (`#123+`)
but _not_ for ones like `+`, `.+` or `/foo/+`:
The problem only occurs when a number is followed by a direction (`-`/`+`).
Following along with the example `3-` through `address` (in addr.c):
We read `3` into `c` and match the `case` on line 239.
The `while` loop on line 242ff reads additional digits into `c`
and puts the first non-digit back by decrementing the index `q`.
Then we find the range for line 3 on line 251 and continue.
On the next iteration, we set `prevc` to the last `c`,
but since that part read ahead _into `c`_,
`c` is currently the _next_ character we will read, `-`,
and now `prevc` is too.
Then in the case block (line 210) the condition on line 211 holds
and Acme believes that it has read two `-` in sequence
and modifies the range to account for the “first” `-`.
The “second” `-` gets applied after the loop is done, on line 292.
So the general problem is:
While reading numbers, Acme reads the next character after the number into `c`.
It decrements the counter to ensure it will read it again on the next iteration,
but it still uses it to update `prevc`.
This change solves the problem by reading digits into `nc` instead.
This variable is used to similar effect in the block for directions (line 212)
and fills the role of “local `c` that we can safely use to read ahead” nicely.
|
|
|
|
Before, executing Get in a file rewound the window offset and
selection to the start of the file.
After this CL, Get preserves the window offset and selection,
where preserve is defined as "the same line number and rune
offset within the line". So if the window started at line 10
before and the selection was line 13 chars 5-7, then that
will still be true after Get, provided the new content is large
enough.
This should help the common situation of plumbing a
compiler error, realizing the window is out of date,
clicking Get, and then losing the positioning from the
plumb operation.
|
|
Thanks to Lorenzo Beretta for noticing.
|
|
Bad remote file systems can change mtime unexpectedly,
and then there is the problem that git rebase and similar
operations like to change the files and then change them back,
modifying the mtimes but not the content.
Avoid spurious Put errors on both of those by checking file
content.
(False positive "modified since last read" make the real ones
difficult to notice.)
|
|
Change-Id: Ie9332ed473609bd6ca156be0843dc5411cbf7b93
Reviewed-on: https://plan9port-review.googlesource.com/2941
Reviewed-by: Russ Cox <rsc@swtch.com>
|
|
Should be a clean build now.
Change-Id: Id3460371cb5e8d4071f8faa9c2aec870d213a067
Reviewed-on: https://plan9port-review.googlesource.com/2781
Reviewed-by: Russ Cox <rsc@swtch.com>
|
|
Currently new, put and del events are being logged.
This patch adds a focus event to the log
whenever the user changes the focus to another window.
This lets programs react to files being edited in acme
without the need of being restarted.
Change-Id: Idf35c0d7dbfca30e79724dc9f49e44c6a4eb6a1e
Reviewed-on: https://plan9port-review.googlesource.com/1140
Reviewed-by: Russ Cox <rsc@google.com>
|
|
Credit to Roi Martin <jroi.martin@gmail.com> for noticing that
libdraw was being passed a negative string length and for finding the
sequence of keystrokes that make acme do it reproducibly.
Change-Id: If3f3d04a25c506175f740d3e887d5d83b5cd1bfe
Reviewed-on: https://plan9port-review.googlesource.com/1092
Reviewed-by: Russ Cox <rsc@swtch.com>
|
|
Acme tracks the most recent typing insertion point and
the home and end keys stop there on their way
up to the top or down to the bottom of the file.
That point should be iq1, and it should be adjusted
properly so that it's always between 0 and t->file->b.nc inclusive.
(This is all code from an external contributor, years old at this
point but new since Plan 9.)
Somehow, sometimes iq1 ends up a little beyond b.nc,
and when passed to textbacknl it crashes acme in bufread.
I can't see how that can happen but if it does, avoid the crash.
It's tempting to pull the insertion point code out entirely
but this is a little less invasive and should fix things for now.
TBR=rsc
https://codereview.appspot.com/107730043
|
|
We ran for a long time with 10ms kernel resolution,
so 10ms user space resolution here should be fine.
Some systems actually provide 1ms sleeps, which
makes this polling use a bit more cpu than we'd like.
Since the timers are for user-visible things, 10ms should
still be far from noticeable.
Reduces acme's cpu usage on Macs when plumber is missing
(and plumbproc is sleeping waiting for it to appear).
LGTM=aram, r
R=r, aram
https://codereview.appspot.com/99570043
|
|
This breaks ^C in win windows, as expected.
People use ^C, win expects and handles ^C,
so I don't think we can just take it away.
I've noticed that it is broken but assumed my ssh
was screwed up.
If you want to make WindowsKey+C,X,V do the
operations, by analogy with command+C,X,V
on Mac, that's fine with me.
««« original CL description
acme: copy/cut/paste with ctl+c,x,v
LGTM=rsc
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/69070045
»»»
TBR=rsc
CC=burns.ethan, r
https://codereview.appspot.com/96410045
|
|
TBR=rsc
https://codereview.appspot.com/95010048
|
|
Reading /mnt/acme/log reports a log of window create,
put, and delete events, as they happen. It blocks until the
next event is available.
Example log output:
8 new /Users/rsc/foo.go
8 put /Users/rsc/foo.go
8 del /Users/rsc/foo.go
This lets acme-aware programs react to file writes, for example
compiling code, running a test, or updating an import block.
TBR=r
R=r
https://codereview.appspot.com/89560044
|
|
TBR=r
https://codereview.appspot.com/89510044
|
|
Bakul Shah has observed corrupted files being written
when acme writes over osxfuse to sshfs to a remote file system.
In one example we examined, acme is writing an 0xf03-byte
file in two system calls, first an 0x806-byte write and then a 0x6fd-byte
write. (0x806 is BUFSIZE/sizeof(Rune); this file has no multibyte UTF-8.)
What actually ends up happening is that an 0x806-byte file is written:
0x000-0x6fd contains what should be 0x806-0xf03
0x6fd-0x7fa contains zeros
0x7fa-0x806 contains what should be 0x7fa-0x806 (correct!)
The theory is that fuse or sshfs or perhaps the remote file server is
mishandling the unaligned writes. acme does not seem to be at fault.
Using bio here will make the writes align to 8K boundaries,
avoiding the bugs in whatever underlying piece is broken.
TBR=r
https://codereview.appspot.com/89550043
|
|
TBR=r
https://codereview.appspot.com/89390043
|
|
LGTM=rsc
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/69070045
|
|
TBR=rsc
https://codereview.appspot.com/74060043
|
|
- the cursor is on the last line
- the navigation would put the cursor over the tag of the following text
R=rsc
CC=smckean83
https://codereview.appspot.com/15280045
|
|
This allows commands in bin subdirectories.
R=rsc
CC=plan9port.codebot
https://codereview.appspot.com/13254044
|
|
Introduces the Search command for mailboxes.
Arguments passed are treated as one space-
separated string, passed on to mailfs' IMAP
search interface.
R=rsc, david.ducolombier
CC=plan9port.codebot
https://codereview.appspot.com/13238044
|
|
Mail services (such as Google Mail) will often have
directories with names that contain spaces. Acme
does not support spaces in window names. So, replace
spaces in mail directory names with the Unicode
character for visible space.
The code is a bit of an over-approximation and
generally non-optimal.
R=rsc, david.ducolombier, 0intro
CC=plan9port.codebot
https://codereview.appspot.com/13010048
|
|
R=rsc
https://codereview.appspot.com/12162043
|
|
R=rsc
http://codereview.appspot.com/6854094
|
|
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/6854092
|
|
R=rsc
http://codereview.appspot.com/6736060
|
|
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/6614056
|
|
R=rsc
http://codereview.appspot.com/6744053
|
|
R=rsc, r
CC=plan9port.codebot
http://codereview.appspot.com/6586067
|
|
If the mouse was in the tag of the old window,
it was most likely pointing at Del. If bringing up a
new window from below and not moving the mouse
somewhere else, adjust it so that it ends up pointing
at Del in the replacement window's tag too.
This makes it easy to Del a sequence of windows in
a column, from top to bottom.
http://www.youtube.com/watch?v=ET8w6RT6u5M
R=r
http://codereview.appspot.com/6558047
|
|
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5505091
|
|
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5399050
|
|
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4974060
|
|
R=rsc
http://codereview.appspot.com/4816066
|
|
Home and End previously navigated between
two different window locations: the top and
the bottom of the text. Now they include a
third waypoint: the location where typing last
happened. Thus, in a win window, typing
ls -l
<home>
scrolls to the beginning of the ls -l output.
A second <home> continues to the top of the file.
Makes Send scroll always, along with writes by
external programs to +Errors.
R=r
CC=mccoyst
http://codereview.appspot.com/4830051
|
|
Fixes issue 80.
R=rsc
http://codereview.appspot.com/4662088
|
|
R=rsc
http://codereview.appspot.com/4690042
|
|
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4539098
|
|
Ignore scroll/noscroll window setting.
Instead, scroll when the write begins in
or immediately after the displayed window content.
In the new scrolling discipline, executing
"Noscroll" is replaced by typing Page Up or
using the mouse to scroll higher in the buffer,
and executing "Scroll" is replaced by typing End
or using the mouse to scroll to the bottom of
the buffer.
R=r, r2
http://codereview.appspot.com/4433060
|
|
R=rsc
CC=codebot
http://codereview.appspot.com/2007045
|
|
R=r
http://codereview.appspot.com/1765042
|
|
R=r
http://codereview.appspot.com/868046
|
|
R=r
http://codereview.appspot.com/583043
|
|
R=, rsc
CC=
http://codereview.appspot.com/188042
|
|
R=rsc
CC=codebot
http://codereview.appspot.com/161048
|
|
message
http://codereview.appspot.com/123051
|
|
http://codereview.appspot.com/116083
|