aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
Commit message (Collapse)AuthorAgeFilesLines
* initHEADmasterEthan Morgan40 hours3-87/+106
|
* all: remove need for `-fcommon`Dan Cross2025-07-255-63/+126
| | | | | | | | | | Use `extern` where appropriate so that we can remove `-fcommon` on macOS and others. On macOS, `-fcommon` generates a number of linker warnings. I've tested building on macOS, Linux, FreeBSD, NetBSD, OpenBSD and illumos. I am not in a position to test on AIX or other more esoteric platforms, however.
* acme: remove debug printRuss Cox2024-06-151-1/+0
|
* acme: shift button 3 for reverse searchRuss Cox2024-06-157-70/+152
| | | | | An experiment. Let's see if it's any good. Also document the Mac conventions in devdraw(3).
* acme: clean up environment after execRuss Cox2024-04-061-0/+9
| | | | Make up for the lack of a real rfork(RFENVG).
* acme: have Dump save both low and high DPI fontnamesmatheuristic2023-09-051-4/+13
| | | | | | | | Instead of only saving a window's currently displayed font's name to the dump file, have Acme's Dump command save that window's combined low DPI and high DPI font names when both are available. See 9fans/plan9port#630
* acme: allow larger paste amountsRuss Cox2023-01-061-1/+1
|
* fix indentationDerek Stevens2022-09-071-1/+1
|
* acme/wind.c: redraw window body with bg color if too small for a single ↵Derek Stevens2022-09-071-0/+1
| | | | line; ref #10
* acme: accept paths with spaces in the 'name' ctl messageIgor Burago2022-09-071-1/+1
| | | | | | | | As it is allowed to use spaces in file names set interactively through the tag since 7b1c85f, do not reject names with spaces in the 'name' ctl message either. Fixes #559.
* trim button & modbutton imagesAndriy Symonovych2022-07-261-3/+1
|
* make sure border has correct heightAndriy Symonovych2022-07-261-1/+1
|
* acme: Don't move the mouse if button depressedBen Huntsman2022-07-261-1/+4
| | | | Fixes #19
* src/cmd/acme: provide info on presense or absence of undo history (#528)Roger Peppe2021-10-192-2/+4
| | | | | | It's sometimes useful to know whether there's been editing activity in a window. This PR adds that information to the ctl file. Change-Id: I21a342ac636dd5c7701b3ed560e3526867329c2c
* acme: fix extra print argsRuss Cox2021-09-281-2/+2
|
* acme: fix double-free in acmeerrorprocRuss Cox2021-03-231-4/+2
| | | | The receiver of cerr takes ownership of s.
* acme, sam, samterm: remove weird switch usageRuss Cox2021-01-051-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.
* acme: allow @ in file namesRuss Cox2020-12-301-1/+1
| | | | For upspin and other tools that put email addresses in names.
* acme: add font control messageRuss Cox2020-07-181-0/+18
|
* acme: avoid global named "class"Russ Cox2020-05-181-0/+3
| | | | For AIX.
* acme: scale window bodies on resize, not including tag spaceRuss Cox2020-03-301-3/+5
| | | | This avoids reopening collapsed windows after a large vertical resize.
* acme: report close failure in Put, this time for sureRuss Cox2020-01-241-5/+5
| | | | Missed in 0b349f6f that Bterm is not closing fd.
* acme: save/restore multiline tags in Dump/LoadRuss Cox2020-01-141-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.
* acme: fix buffer overflow introduced in parsetag refactorRuss Cox2020-01-133-8/+8
|
* acme: fix movetodel for spaces in file namesRuss Cox2020-01-131-11/+8
|
* acme: allow spaces in window namesRuss Cox2020-01-132-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.
* acme: one more place to use parsetagRuss Cox2020-01-131-5/+1
|
* acme: factor out tag parsing codeRuss Cox2020-01-133-21/+28
|
* acme: fix crash in X |cat with multiple windowsRuss Cox2020-01-131-5/+24
| | | | | | | Fixes #9. Fixes #219. Fixes #222. Fixes #330.
* Trivial changes: whitespace and modes.Dan Cross2020-01-1017-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>
* acme: do not pass null pointers where disallowedNeven Sajko2020-01-022-1/+4
| | | | | | The C standards disallow passing null pointers to memmove and memcmp. Change-Id: I1c88c2adbc32a23ef742f206038b8f7c4e0540c7
* acme: report close failure during PutRuss Cox2019-12-191-2/+6
|
* acme: accept expanded URLs in lookRuss Cox2019-06-101-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.
* acme: delete trailing spaces during Put in autoindent modeRuss Cox2019-05-171-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.
* acme: do not trim spaces during PutRuss Cox2019-04-191-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.)
* acme: Update tag after receiving menu/nomenu control event (#251)Martin Kühl2019-04-051-0/+2
|
* acme: drop trailing spaces during Put of auto-indent windowRuss Cox2019-02-011-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.
* acme: add 32x32 boxcursorRuss Cox2018-11-154-2/+71
| | | | | | The only difference from the upscaled 16x16 is a one-pixel adjustment in the offset position, but this at least exercises setcursor2.
* acme: avoid division by zero when resizing col (#189)Fazlul Shahriar2018-11-131-2/+6
| | | | To reproduce, create a column with at least two windows and resize acme to have almost zero height.
* acme: Apply each -/+ only once (#156)Martin Kühl2018-09-191-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.
* acme: fix some memory leaksXiao-Yong Jin2018-03-273-2/+8
|
* acme: preserve window position and selection during GetRuss Cox2017-11-025-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.
* acme: free buf in checksha1Russ Cox2017-10-141-0/+1
| | | | Thanks to Lorenzo Beretta for noticing.
* acme: check file content before declaring file "modified since last read"Russ Cox2017-10-1023-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.)
* acme: implement Cmd-Shift-Z for Redo on MacRuss Cox2017-07-161-0/+4
| | | | | | Change-Id: Ie9332ed473609bd6ca156be0843dc5411cbf7b93 Reviewed-on: https://plan9port-review.googlesource.com/2941 Reviewed-by: Russ Cox <rsc@swtch.com>
* all: fix or silence all INSTALL warnings on macOSRuss Cox2017-01-061-1/+1
| | | | | | | | Should be a clean build now. Change-Id: Id3460371cb5e8d4071f8faa9c2aec870d213a067 Reviewed-on: https://plan9port-review.googlesource.com/2781 Reviewed-by: Russ Cox <rsc@swtch.com>
* acme: add focus change to logSergiusz Urbaniak2015-06-031-0/+6
| | | | | | | | | | | | | 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>
* libdraw, libframe, acme: fix, guard against inverted range in textsetselectRuss Cox2014-12-021-3/+9
| | | | | | | | | | 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: fix bufread crash due to typing-point scrollingRuss Cox2014-06-031-0/+4
| | | | | | | | | | | | | | | | | | | | 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
* acme: increase timer resolution to 10msRuss Cox2014-06-031-1/+1
| | | | | | | | | | | | | | | | 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