aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
AgeCommit message (Collapse)AuthorFilesLines
2021-02-18Merge remote-tracking branch 'upstream/master'HEADmasterPetter Rodhelind2-3/+5
2021-01-05acme, sam, samterm: remove weird switch usageRuss Cox1-2/+4
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.
2020-12-30acme: allow @ in file namesRuss Cox1-1/+1
For upspin and other tools that put email addresses in names.
2020-12-18Merge remote-tracking branch 'upstream/master'Petter Rodhelind1-0/+18
2020-07-18acme: add font control messageRuss Cox1-0/+18
2020-06-18Merge remote-tracking branch 'upstream/master'Petter Rodhelind1-0/+3
2020-05-18acme: avoid global named "class"Russ Cox1-0/+3
For AIX.
2020-05-06Merge remote-tracking branch 'upstream/master'Petter Rodhelind1-3/+5
2020-03-30acme: scale window bodies on resize, not including tag spaceRuss Cox1-3/+5
This avoids reopening collapsed windows after a large vertical resize.
2020-02-11Merge remote-tracking branch 'upstream/master'Petter Rodhelind2-9/+21
2020-01-24acme: report close failure in Put, this time for sureRuss Cox1-5/+5
Missed in 0b349f6f that Bterm is not closing fd.
2020-01-14acme: save/restore multiline tags in Dump/LoadRuss Cox1-4/+16
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.
2020-01-14Merge remote-tracking branch 'upstream/master'Petter Rodhelind20-177/+214
2020-01-13acme: fix buffer overflow introduced in parsetag refactorRuss Cox3-8/+8
2020-01-13acme: fix movetodel for spaces in file namesRuss Cox1-11/+8
2020-01-13acme: allow spaces in window namesRuss Cox2-5/+20
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.
2020-01-13acme: one more place to use parsetagRuss Cox1-5/+1
2020-01-13acme: factor out tag parsing codeRuss Cox3-21/+28
2020-01-13acme: fix crash in X |cat with multiple windowsRuss Cox1-5/+24
Fixes #9. Fixes #219. Fixes #222. Fixes #330.
2020-01-10Trivial changes: whitespace and modes.Dan Cross17-133/+129
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>
2020-01-02acme: do not pass null pointers where disallowedNeven Sajko2-1/+4
The C standards disallow passing null pointers to memmove and memcmp. Change-Id: I1c88c2adbc32a23ef742f206038b8f7c4e0540c7
2019-12-19acme: report close failure during PutRuss Cox1-2/+6
2019-07-20Merge remote-tracking branch 'upstream/master'Petter Rodhelind2-50/+103
2019-06-10acme: accept expanded URLs in lookRuss Cox1-9/+39
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.
2019-05-17acme: delete trailing spaces during Put in autoindent modeRuss Cox1-41/+64
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.
2019-05-10Merge remote-tracking branch 'upstream/master'Petter Rodhelind2-4/+10
2019-04-19acme: do not trim spaces during PutRuss Cox1-4/+8
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.)
2019-04-05acme: Update tag after receiving menu/nomenu control event (#251)Martin Kühl1-0/+2
2019-02-05Merge remote-tracking branch 'upstream/master'Petter Rodhelind1-3/+38
2019-02-01acme: drop trailing spaces during Put of auto-indent windowRuss Cox1-3/+38
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.
2019-01-07Merge remote-tracking branch 'upstream/master'Petter Rodhelind4-4/+77
2018-11-15acme: add 32x32 boxcursorRuss Cox4-2/+71
The only difference from the upscaled 16x16 is a one-pixel adjustment in the offset position, but this at least exercises setcursor2.
2018-11-13acme: avoid division by zero when resizing col (#189)Fazlul Shahriar1-2/+6
To reproduce, create a column with at least two windows and resize acme to have almost zero height.
2018-10-01Merge remote-tracking branch 'upstream/master'Petter Rodhelind1-3/+3
2018-09-19acme: Apply each -/+ only once (#156)Martin Kühl1-3/+3
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.
2018-04-20Merge remote-tracking branch 'upstream/master'Petter Rodhelind3-2/+8
2018-03-27acme: fix some memory leaksXiao-Yong Jin3-2/+8
2018-01-27acme: Do not hide dotfiles, since xplor does that nicely.Petter Rodhelind1-3/+3
2017-11-06Merge remote-tracking branch 'upstream/master'Petter Rodhelind5-18/+103
2017-11-02acme: preserve window position and selection during GetRuss Cox5-18/+103
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.
2017-10-22acme: Move one line up/down using ^P and ^N.Petter Rodhelind1-32/+42
2017-10-16acme: Hide dotfiles in dirs.Petter Rodhelind1-0/+3
These can easily be shown in a win-window with 'ls -a'...
2017-10-16Merge remote-tracking branch 'upstream/master'Petter Rodhelind23-13/+80
2017-10-14acme: free buf in checksha1Russ Cox1-0/+1
Thanks to Lorenzo Beretta for noticing.
2017-10-10acme: check file content before declaring file "modified since last read"Russ Cox23-13/+79
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.)
2017-08-03acme: Use the same tabstop setting in cloned/zerox window as in the source ↵Petter Rodhelind1-0/+1
window.
2017-08-01Merge remote-tracking branch 'upstream/master'Petter Rodhelind1-2/+4
2017-07-16acme: implement Cmd-Shift-Z for Redo on MacRuss Cox1-0/+4
Change-Id: Ie9332ed473609bd6ca156be0843dc5411cbf7b93 Reviewed-on: https://plan9port-review.googlesource.com/2941 Reviewed-by: Russ Cox <rsc@swtch.com>
2017-05-24Syntax cleanupPetter Rodhelind1-8/+7
...and the use of TRUE/FALSE instead of 1/0 for explicicy
2017-05-24Fix segfault when TAB in other places than body textPetter Rodhelind1-0/+2