Commit Graph

4645 Commits

Author SHA1 Message Date
Danny Yoo
5bc070d1d8 Optimize stick-to-next-sexp? to speculative match before using forward-match.
Profiler output suggests that forward-match is a bit expensive.  Here
is profiler output from the original code, when profiler is wrapped
around tabify-selection:

------------------------------------------------------------------------------------------------------------
                                  loop [34]                                                             0.1%
                                  get-backward-sexp method in ...k/private/racket.rkt:425:2 [28]       99.9%
 [37] 50648(61.1%)     0(0.0%)  stick-to-next-sexp? method in ...k/private/racket.rkt:425:2 ...
                                  do-forward-match method in ...rk/private/color.rkt:71:2 [50]         99.9%

...

------------------------------------------------------------------------------------------------------------
                                  get-forward-sexp method in ...k/private/racket.rkt:425:2 [38]        17.1%
                                  stick-to-next-sexp? method in ...k/private/racket.rkt:425:2 [37]     82.9%
 [50] 61043(73.6%)    53(0.1%)  do-forward-match method in ...rk/private/color.rkt:71:2 ...
                                  colorer-driver method in ...rk/private/color.rkt:71:2 [66]           99.8%
                                  match-forward method in paren-tree% [72]                              0.1%
------------------------------------------------------------------------------------------------------------

The patch does the prerequisite string matching before calling forward-match.

Reference to dev list: http://lists.racket-lang.org/dev/archive/2012-November/010976.html

original commit: 43b0e2157c5247653da96d24dee833be429c4bfc
2012-11-26 13:42:49 -07:00
Robby Findler
28aa5e9f26 fix some right/top mixups
closes PR 13312

original commit: df5ee4c7bac01f87d3cfd75846cda4152bf0da5b
2012-11-26 12:23:27 -06:00
Robby Findler
528ac68d11 fix one way that rectangles could have the left side be to the
right of the right side

original commit: f8793c0cc2be9a4592ffd12c620920eadb1dee49
2012-11-26 10:56:04 -06:00
Robby Findler
6d9a8922d6 fix bug in error checking code
original commit: ba89a5da9229749995fe6e6e8995684f4ab98dba
2012-11-26 07:55:18 -06:00
Robby Findler
c347ec91c2 tweak to Nadeem's commit
original commit: 49a0b950b79b0f20095d73b690a84c93c39920d6
2012-11-25 22:07:28 -06:00
Nadeem Abdul Hamid
02d9926410 automatic parenthesis mode improvements
Handle close parentheses in a smarter way while in
auto-parens mode and be a little more smart about
inserting brace pairs in general.

In summary:

 - Add some "smart-skip" behavior to insert-close-paren,
   described in the documentation.
    - When auto-parens mode is enabled,
      the existing "balance-parens" keybinding invokes
      insert-close-paren with a smart-skip argument of
      'adjacent
    - A new "balance-parens-forward" keybinding invokes
      insert-close-paren with a smart-skip argument of
      'forward (whether or not auto-parens mode is
      enabled)

 - Enable basic smart-skip behavior for
   strings ("...") and |...| pairs, specifically, typing
   a double-quote or bar character when the cursor
   immediately precedes one causes the cursor to simply
   skip over the existing one

 - Tweak auto-insertion of block comment pairs; i.e.
   typing hash and a bar results in a properly balanced
   #||# pair. Also, when you type a bar character when
   the cursor immediately precedes a closing bar and
   hash of a comment, then the cursor skips over both
   characters (this seems better than having it just
   skip over the bar, and then having to introduce a
   new keybinding to detect when a hash is typed while
   the cursor is between a bar and a hash)

 - In strings and line/block comments, auto-parens mode
   no longer has any effect (you can still use the M+..
   keybindings to force insertion of a particular brace
   pair)

 - Detect when a character constant is being typed, and
   don't insert brace pairs if so; i.e. if the cursor
   is immediately after #\ , then typing any open parens,
   double quote, or bar, does _not_ result in the
   insertion of an open/close pair even in auto-parens
   mode

 - Add a bunch of tests related to auto-parens, matching
   pairs of braces, strings, comments, etc. to
   collects/tests/framework/racket.rkt

original commit: 8f3343cd0129001aa9c7ce263f58e8ed4929c15c
2012-11-25 21:57:52 -06:00
Robby Findler
2559cc2800 improve the interactivity of DrRacket's search
Changes the implementation of highlight-range so that it
only recomputes all of the new locations from the positions
when on-reflow is called (otherwise only computing the
relevant ones) and make the on-reflow callback chop itself
up, in case there are lots of highlighted ranges to avoid
tying up the event loop.

Changes searching so that it doesn't neccessarily compute
the entire search results in a single event callback
(but also make it start the computation more aggressively)

Overall, this changes the strategy from one that, for any potentially
long-running callback, just tried to push it off into the future, into
a strategy that tries to avoid long-running callbacks by breaking the
work up into chunks, but starting the first chunk immediately (in a
low-priority callback).

Also, misc other changes to make this work better and generally clean
things up.

original commit: 5197649cb7556abd96282d3a838c4ba4f7c8de8c
2012-11-25 20:58:13 -06:00
Robby Findler
f3b9e2ed13 Adjust text%s so they don't call on-reflow as often
Specifically, when a style change happens that ends up
not changing the size of anything, then track that
lack of size change enough to be able to avoid
calling on-reflow.

This is important for the interaction between the
colorer and the search bubbles in DrRacket. That is,
when you make an edit that causes the colorer to have
lots of work, then each chunk of work it does before
yielding control to the event loop would also trigger
a call to on-reflow, which would cause the search bubbles
to recompute their sizes. Overall, the main bad thing
this does is cause lots of allocation and aside from
that it doesn't hurt interactivity. Still, there is a
lot of useless work here, and those extra GCs can be
pretty substantial when you're doing something crazy like
searching for " " in a big file.... (there are 95k spaces
in unit.rkt, in case you were curious)

original commit: 0264d3d5adca4a85f1fad65a89165184f5286459
2012-11-25 20:58:13 -06:00
Robby Findler
33826c1585 fix a coloring bug
also, add a little more logging to the aspell logging info

original commit: 793ee71e69dda5924b59a95ce1a3b7492331b2ac
2012-11-24 14:05:45 -06:00
Robby Findler
4c11468ec8 made the install-plt menu item's browse
file dialog show files with ".plt" by default.

Also, clarified the docs for finder:default-extension

closes PR 13104

original commit: 11a5721b59d1400900d67f825470e6ee6f7d6b8a
2012-11-22 20:35:06 -06:00
Robby Findler
a306f9577d fix docs bug in recent commit
original commit: e55d32b2ebf76e778f4793f334a622f84de8fb31
2012-11-22 20:02:59 -06:00
Robby Findler
df61dc8953 added spelling dictionary support
related to PR 13242

original commit: 5b18645a9a5f1646d69f6d3ff1b761cb7def3e65
2012-11-22 19:24:22 -06:00
Robby Findler
2398f08ed5 make right-clicking on non-text offer copy and cut in the
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

original commit: 6fff8a3030bfaddd0eb8113c9f67d6b7e70500ff
2012-11-22 17:33:34 -06:00
Robby Findler
3fdd763928 fix c:c;c:b so it removes {}s
closes PR 13211

original commit: 316bbcb038bc1472c71b4bdd58972e86a3776c30
2012-11-22 10:25:57 -06:00
Robby Findler
469e4203dc fix dynamic require for moved file
original commit: d5f605f58d4fc99ee2b17b0f44f20f0a8c9b72fe
2012-11-22 09:27:07 -06:00
Matthew Flatt
ac6754647a racket/gui gtk: fix end-doc' for printer-dc%'
Contract demands a void result.

original commit: 31f7cfb4867ba5a6b7367eeea32058f0c44fd001
2012-11-20 07:15:28 -07:00
Matthew Flatt
f1ea63c87d racket/gui/dynamic: make gui-dynamic-require' pull from racket/gui/base'
It was pulling from `scheme/gui/base', instead. The one from `scheme/gui/base'
is now different and still pulls from `scheme/gui/base'.

This could break some programs that accidentally depended on `scheme/gui/base'
exports from `gui-dynamic-require', but it's more likely to fix problems.

original commit: 702df4b07add593618713500e7236b5bd75067b3
2012-11-19 08:13:48 -07:00
Matthew Flatt
a4e38f71d5 scheme/gui/base: fix module-attach problem in `make-gui-base-namespace'
The `scheme/base' module had become unreachable from the `mred' module.
While that normally would be a good thing, it lead to troublesome
multiple instantiations of `scheme/base' that caused problems for
attaching further modules to the namespace.

original commit: d90fbaeff469b7accd3cc408e1bbda664a25670b
2012-11-19 07:56:48 -07:00
Matthew Flatt
9ed66c31f2 racket/gui: fix docs for `printer-dc%' and related functions
A page-setup dialog is now available on all platforms, which means
that no dialog will appear when a `pirinter-dc%' is created. Meanwhile,
note that `end-doc' normally shows a (different) dialog.

original commit: 843aa670e96fe34f1b2426ba76f7cc44ceefb867
2012-11-18 10:31:21 -07:00
Robby Findler
80950cd990 change the way that the delegate text is specified, using
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.

original commit: d0ce0de3988f02c5b260aa663fac95134b877761
2012-11-16 14:33:17 -06:00
Robby Findler
1a5c4047dc adjust the code that maintains the blue "where am I" background
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)

original commit: 6fc70a04d8b69f41d82c3bcbeeff26254017052d
2012-11-16 14:33:00 -06:00
Robby Findler
8311497772 unbreak the contour window
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

original commit: 052ee14afc748929f9195620c183f053d307ac21
2012-11-16 14:32:45 -06:00
Robby Findler
5963c92d63 add the name of the function to the message string in the gui-event logger
original commit: 3aac6ec7152130046fca86ab272a1e5da4d3fdd3
2012-11-16 07:26:38 -06:00
Robby Findler
67660d780d move follow-log.rkt to tests/drracket
original commit: 12e8332c55db0e1eb805cbc00760130886068190
2012-11-16 07:26:38 -06:00
Robby Findler
2b2ef68523 fix bad require in follow-log.rkt and add some more histogram utils
original commit: d11f63bd466814e0a51f81899350805731263f2e
2012-11-15 12:22:13 -06:00
Robby Findler
7c1a84556d improve drracket's event log following code
- add support for getting a histogram of event timings

 - add support for scripting drr to be able to make comparisons

original commit: a9b6f8ea46076d2c6cc75bf0d3f8c8a2c1c4f3c6
2012-11-15 07:49:04 -06:00
Robby Findler
198b721c04 make the 'failed to click on the radio box' error message more helpful
original commit: 8c47dbba01c47f26d725420fa49e3812f737ec80
2012-11-11 20:13:25 -06:00
Robby Findler
0d6bebe533 improve drracket's response to an unhappy aspell program
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)

original commit: c5330194a9a992a8f34781327ff0975624399660
2012-11-10 13:00:09 -06:00
Robby Findler
8cef172845 add support for collecting backtraces
original commit: 87dae0df7a3c874a57cc7dd903fc30b69b11a459
2012-11-08 07:45:19 -06:00
Robby Findler
5447be30b5 should have been removed in an earlier commit, but I wrote
the wrong git commandline

original commit: d20f9a88666dd981c1836593d5b932dc22b18914
2012-11-07 21:52:14 -06:00
Robby Findler
bdbce79374 make the log follower always available in DrRacket
original commit: 741be85f07f6d9fc66f3fa7ea9f679a2d9ad2c2a
2012-11-07 16:07:07 -06:00
Matthew Flatt
60d67d2552 racket/gui: add `get-current-mouse-state'
original commit: 7b04571facdafe778bfb05f9c54d7da6d467b05d
2012-11-07 14:37:39 -07:00
Eli Barzilay
5b1e17cc7c Lots of bad TAB eliminations.
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>".

original commit: 672910f27b856549ad08d38832b6714edf226c8e
2012-11-07 11:22:20 -05:00
Eli Barzilay
ab6d9e0762 #lang racket' -> #lang racket/base' conversions in drracket and in redex.
original commit: 26045a27fb1f1faeb8c9ba1208366e6c519fba52
2012-11-07 08:03:44 -05:00
Eli Barzilay
fa9becf12f Some more #lang racket' -> #lang racket/base' conversions
(And some other related minor racketisms.)

original commit: 39a0ab60a78d6d60e8c20450f10b273261c0d325
2012-11-07 08:03:44 -05:00
Robby Findler
80ea492441 clarify the way the undoable? flag in begin-edit-sequence works
original commit: f311676096bbcb216c0a601ba0191c3391defb8b
2012-11-06 09:46:17 -06:00
Robby Findler
14747de35e audit the calls to invalidate-bitmap-cache in the framework and in
drracket and try to make them happen less often (or, if there will be
multiple ones, try to guarantee that there is an edit sequence)

original commit: 81dc3bae37690e066204051b8b32d7db16ce4a67
2012-11-04 19:02:55 -06:00
Robby Findler
1d775e0b57 adjust log following to make it work for the middle of a drracket
editing session

original commit: ef3eb3154aa21d83c100d7664121c92eba174959
2012-11-04 14:39:55 -06:00
Matthew Flatt
0dff615872 racket/gui: fix problems with control labels and client/global positions
Closes PR 13232

original commit: 068240e9fefd7bfe7dbbbc9b3cad98bc191ee78a
2012-11-04 08:47:50 -07:00
Matthew Flatt
94dea09048 racket/gui: add delete' to choice%' and `list-control<%>'
Closes PR 13230

original commit: 0c82f54912a2a2d3e087ab8c8a533b42008d6080
2012-11-04 08:25:43 -07:00
Matthew Flatt
c08ebddadb error message repair
original commit: ad703025c5d2c0d254f708bad9e854ce4894907b
2012-11-04 06:09:21 -07:00
Robby Findler
49889e566b add find-labelled-windows
original commit: e1760fa7c0690697a97343faf3d4991990c19c91
2012-11-03 13:54:48 -05:00
Robby Findler
6706264ae8 fix test so that labels can be regexps (as was already
documented) and tidy up framework/test docs

original commit: c375042f10fc1440fb56a2ef867f42e24f16bb39
2012-11-03 13:54:48 -05:00
Robby Findler
274cce0439 make popup menus respond to mouse-up events, not mouse-down ones
original commit: 0377bda9474f8848a97509ace898174c83361006
2012-11-02 20:32:55 -05:00
Asumu Takikawa
d4ac5ab683 Fix typo
Closes PR 13158

original commit: 4948ca0863a26f9b1ab68ad2a5e606a8c7f538b2
2012-11-02 18:17:38 -04:00
Robby Findler
4d5c904778 It appears that the colorer was always creating a new port to read
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.)

original commit: 4ead534227fcbf8e90d0cc5e890f0a67fe6b05cb
2012-11-02 10:24:34 -05:00
Robby Findler
16d9b00f05 lift the restriction that the port passed to open-input-text-editor
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

original commit: 95841b9303a753c5b85a929dbfe6167b12407343
2012-11-02 10:24:34 -05:00
Robby Findler
b801edee42 reindent the implementation of open-input-text-editor
Apologies for the gratuitious reindent, but I was having
a lot of trouble reading this file; it appears to have
last been worked on in an Emacs that used tabs for indentation
and doesn't use the same tab width as drracket.

original commit: 6c760b086fc87163bf3c7086c16efbe845a9b08b
2012-11-02 10:24:34 -05:00
Robby Findler
6cce05a331 added a script that collects log messages for use in performance debugging drracket
original commit: 6f5e43b851b613ec9237e565d69fcb8b17e81870
2012-11-01 21:13:39 -05:00
Robby Findler
7581b3e228 add logging to the colorer
original commit: 9582fe830ae4d0db3b71a02b78d3546521b63bc2
2012-10-31 10:16:16 -05:00