Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
For whatever reason all three of these programs
contain switches like:
switch(x) {
case 1:
if(cond)
case 2:
f();
}
Like Duff's device, this is legal C but more obscure
than it really needs to be.
This commit assumes those are intended as written
and simply writes them more clearly. I did consider
that maybe they are mistakes, but in the case of sam/regexp.c,
my rewrite in this commit matches the acme/regx.c that
has been in plan9port since I added acme in 2003.
(I didn't bother to dig up the old Plan 9 releases.)
Assuming acme/regx.c has been correct for the past
two decades, this commit should be correct too.
|
|
For upspin and other tools that put email addresses in names.
|
|
|
|
|
|
|
|
For AIX.
|
|
|
|
This avoids reopening collapsed windows after a large vertical resize.
|
|
|
|
Missed in 0b349f6f that Bterm is not closing fd.
|
|
The dump substitutes each \n in a multiline tag with a 0xff byte.
Since it is not valid UTF it cannot occur in an ordinary dump file.
Old acmes will just read it in as an error rune.
Fixes #135.
Fixes #153.
|
|
|
|
|
|
|
|
There are many things we could do to make this work.
an environment variable to control the character.
Another option would be to use U+00A0 (non-breaking space),
which renders the same as space.
This change avoids changing the separator character and instead
assumes that if the left side of the tag already ends in " Del Snarf |"
then what comes before that is the file name.
Acme already aggressively preserves the "Del Snarf |",
so this should work decently well as a stop-gap.
We can always try something else later.
Fixes #26.
Fixes #104.
Fixes #329.
|
|
|
|
|
|
Fixes #9.
Fixes #219.
Fixes #222.
Fixes #330.
|
|
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.
Signed-off-by: Dan Cross <cross@gajendra.net>
|
|
The C standards disallow passing null pointers to memmove and memcmp.
Change-Id: I1c88c2adbc32a23ef742f206038b8f7c4e0540c7
|
|
|
|
|
|
Just as look expands a click in /etc/passwd to the full name
(provided that file exists), it now expands a click in https://9fans.net/
to the full URL (provided the prefix is http:// or https://).
Probably more adjustment is needed.
|
|
Autoident mode is the leading cause of trailing spaces on lines.
Remove them during Put to make various picky tools happier.
The changes during Put are added as a separate entry to the
file history, so that the first Undo after Put restores the spaces.
|
|
|
|
The commit that introduced this was pushed accidentally.
It is not a good idea to do this.
(It breaks programs that think that a clean window
means the body matches the on-disk file.)
|
|
|
|
|
|
Auto-indent mode leaves trailing spaces on blank lines
as you type past them, so silently elide them from the
window content as it gets written back to disk.
Another option would be to remove them from the
window entirely during Put, but they're actually nice
to have while editing, and to date Put has never
modified the window content.
|
|
|
|
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.
|
|
|
|
These can easily be shown in a win-window with 'ls -a'...
|
|
|
|
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.)
|
|
window.
|
|
|
|
Change-Id: Ie9332ed473609bd6ca156be0843dc5411cbf7b93
Reviewed-on: https://plan9port-review.googlesource.com/2941
Reviewed-by: Russ Cox <rsc@swtch.com>
|
|
...and the use of TRUE/FALSE instead of 1/0 for explicicy
|
|
|