popup menu
Extends append-editor-operation-menu-items so that when you
pass an editor and a position, it checks to see if that spot
has a non-string% snip and, if so, copies that one position
(or cuts it, depending).
Then, use that extension in DrRacket
closes PR 12791
getter/setters instead of overriding a method
this has the benefit that the delegate does not have to be
rebuilt when switching tabs in drracket; we just leave the
old delegate on the old definitions text, and the swap it
back into the editor-canvas when we swap the text% object
itself back in.
coloring in the contour window to make only a single call to
invalidate-bitmap-cache
It was making two before, which could have pretty similar regions,
leading to two repaints instead of just one. When pushing the down
arrow near the bottom of the visible regions of the definitions text
was causing those two calls to take about 30 milliseconds and after
this change the one call seems to be about half that (but there is
lots of variance so I'm only sure that it helped some, not how much)
A long time ago, I tried to improve the interactiveness
of DrRacket when the contour window was open with the
code that is removed in this commit. Looking at it today,
it seems clear that this code was buggy (and, now that
we've had lots of experience with it, it didn't actually
help with interactivity either)
The problem is that the code didn't record enough
information about the change to the editor in the thunk put
into the 'todo' field. It would remember that a particular
range was out of date, but it woudln't remember which
characters were in that range, so when it would go to copy
the characters, it may be getting the wrong characters
(since another edit may have happened since the thunk was
stored in the todo field)
This change also has the side benefit that the time it takes
to change the contour window is now being tracked by the
colorer, which means that it'll give up a bit sooner
coloring less in each go, but hopefully maintaining the
interactivity
Specifically, two things:
- make drracket more careful to not crash when aspell
doesn't behave, and
- have a more careful test when clicking the menu item
(it now does a trial run of aspell instead of just
looking for the binary)
closes PR 13242 (I realize there is still a feature
request mentioned in the audit trail of that PR, but
since the main problem is fixed, I'll consider that
to just be something separate)
I started from tabs that are not on the beginning of lines, and in
several places I did further cleanings.
If you're worried about knowing who wrote some code, for example, if you
get to this commit in "git blame", then note that you can use the "-w"
flag in many git commands to ignore whitespaces. For example, to see
per-line authors, use "git blame -w <file>". Another example: to see
the (*much* smaller) non-whitespace changes in this (or any other)
commit, use "git log -p -w -1 <sha1>".
from, each time it starts on a new event boundary (this means that in
the old (5.3) version of the colorer, it also created a new co-routine
on each event boundary! (in other words, most of the reason one would
want co-routines here was bogus))
So, refactor the code to just always do this and eliminate a bunch of
set!'s and private fields in favor of just passing arguments like sane
code does. (We can't eliminate all of that, because we still do need
to be able to abort and thus all calls must be tail calls.)
cannot change its revision number during reading
This restriction was enforced only for editors that have non
string-snip% snips. The restriction was in place because the
implementation strategy was to chain thru the snips in the editor
using (send snip next) and that isn't safe if the revision number
changes.
The lifting of the restriction is implemented by tracking the position
in the editor where the last snip ended and, if the revision number
changes, starting over trying to get a snip from that position. This
has the effect that, if the revision number never changes, the code
should behave the same as it was doing before (so hopefully any new
bugs I've introduced in this commit will only show up if the old
implementation would have raised an error)
Also, exploit the lifting of this restriction in the colorer so it
doesn't to restart the port during to coloring that happens along with
the parsing
As it turns out, changing the color (via change-style) can somtimes
split snips, which can change the revision number, which means that
the open port into the editor is no longer valid.
Since this doesn't seem to happen very much when editing in DrRacket,
we just detect this situation and give up on this colorer's port, and
hopefully it actually doesn't happen much (the place it happened that
let me notice this was when inserting an image via a menu in the
drracket test suites)
refactor it so it doesn't add anything to the continuation ever, and
just check if it has been a while since we started (giving other
events a chance to run, if so). Also, interleave the calls to
change-style with the parsing of the buffer to get a more accurate
count of the time the colorer is taking
choose to print to pdf as well. Also, enable the preference
under linux (ie, make it available to be chosen-- all platforms
still default to printing via the platform-specific mechanism)
line-numbers mixin
Specifically, when both are turned on, the #lang line now shows
the line number and shifts the "#lang ..." over to the same spot
where it is drawn when the first line is natually visible
Also, rackety