Commit Graph

75 Commits

Author SHA1 Message Date
Robby Findler
cc0a105e21 another attempt to avoid building rectangles
where the right edge is left of the left edge
2012-12-01 14:50:19 -06:00
Robby Findler
7ac80bbb01 make the paren highlight use non alpha=1 colors so that
the paren highlight composes with other highlighting in the editor
2012-11-30 10:00:46 -06:00
Robby Findler
52d0b7e352 Possible fix for error raised by build-rectangle
When switching tabs while an on-reflow initiated callback
might still be running can lead to bogus information
coming back from position-locations, as the editor loses
its admin.

So, we just give up recomputing the rectangles when the
admin is gone and, for now, expect that there will be
another on-reflow call when the admin comes back that'll
restart the process (not sure that this is guaranteed tho)
2012-11-28 10:54:34 -06:00
Robby Findler
4af72a5825 add a little more info into the build-rectangle check for when it fails 2012-11-26 23:30:10 -06:00
Robby Findler
43e7150fdf clean up the text:searchable docs based on recent changes 2012-11-26 18:42:18 -06:00
Robby Findler
6d56491e8d make unhighlight-range remove only the first matching range, not
all of the matching ranges
2012-11-26 18:42:18 -06:00
Robby Findler
df5ee4c7ba fix some right/top mixups
closes PR 13312
2012-11-26 12:23:27 -06:00
Robby Findler
f8793c0cc2 fix one way that rectangles could have the left side be to the
right of the right side
2012-11-26 10:56:04 -06:00
Robby Findler
ba89a5da92 fix bug in error checking code 2012-11-26 07:55:18 -06:00
Robby Findler
5197649cb7 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.
2012-11-25 20:58:13 -06:00
Robby Findler
052ee14afc 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
2012-11-16 14:32:45 -06:00
Robby Findler
81dc3bae37 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)
2012-11-04 19:02:55 -06:00
Robby Findler
e89a121ae5 add some first-cut logging information to drracket
to track how long events take to be handled
2012-10-26 21:49:44 -05:00
Robby Findler
94a448413e add some highlighting to the line numbers to show where
the insertion point currently is

closes PR 12976
2012-08-07 12:12:45 -05:00
Robby Findler
b5f9751369 add some highlighting to the line numbers to show where
the insertion point currently is

closes PR 12976
2012-08-06 22:24:59 -05:00
Robby Findler
dfa0305bb3 fix interaction between the framework's first-line-mixin and
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
2012-05-15 22:08:42 -05:00
Robby Findler
0d6b825377 add a preference to control whether or not there is an extra
pixel of space in between lines in DrRacket.

This change is based on Matthew's experience having a look
at the font setup on the three platforms.

He writes:
>  * Mac OS X: the convention seems to be to add space between lines.
>   TextEdit, for example, looks like DrRacket: the maze has spaces.
>
>   (I can't find a font that makes the maze look right, actually, even
>   if I adjust the line spacing.)
>
>  * Windows: the convention seems to be that space is built into the
>   font. DrRacket (and SirMail) draw lines more sparsely than Notepad.
>
>   Perhaps consistent with the differing conventions, the height of
>   "Courier New" at 11-pixel size is 14 on Windows, 13 on Mac OS X.
>
>  * Unix: the convention seems to be to add space. DrRacket looks like
>   the default Terminal and Text Editor programs on Ubuntu.
>
>   The maze nevertheless looks right everywhere, because the glyphs
>   extend an extra pixel above the declared bounding box!
2012-03-24 20:20:05 -05:00
Asumu Takikawa
04f7bdbb02 framework: add missing methods to interface and docs
The set-replace-start and get-replace-search-hit methods were
missing in the text:searchable<%> interface. The latter was
also undocumented.
2012-03-01 13:17:48 -05:00
Sam Tobin-Hochstadt
e3609cdb32 Refactor and improve fuzzy searching in completion. 2012-01-13 14:39:05 -05:00
Robby Findler
950d165133 fix the not-a-language message so that the styles in the REPL are right 2012-01-06 20:59:34 -06:00
Robby Findler
458e2c2282 some long overdue Rackety: renaming the 'scheme:' exports of the framework to 'racket:' 2011-11-30 06:45:50 -06:00
Robby Findler
081dc6c9a1 adjust the completions box so that it doesn't raise the error mentioned in 12396 anymore
closes PR 12396
2011-11-26 18:30:25 -06:00
Sam Tobin-Hochstadt
0754e6b702 Make autocompletion fuzzier, similar to the doc search.
For example, autocomplete of `cur-dir' will produce the same list of results as the documentation search, with `current-directory' first, instead of producing no results.
2011-11-13 16:33:17 -05:00
Robby Findler
fcc720f43e adjust uses of after-load-file to use the success? flag 2011-10-08 10:50:27 -05:00
Robby Findler
b71e562284 fix crlf mode initialization 2011-10-01 08:10:25 -05:00
Robby Findler
4a2757f200 Adjust DrRacket so that it saves files with CRLF
line terminators when:

  a) running under windows, and
  b) the file on the disk (when DrRacket first opens it)
     contains all CRLF line endings.

In all other situations, the file is saved with LF terminators.

Before this commit, DrRacket would always use the platform-specific
convention, regardless of the original content of the file.

closes PR 12242
2011-09-30 17:08:07 -05:00
Ryan Culpepper
c7f86d276c removed useless requires 2011-09-27 19:28:44 -06:00
Robby Findler
2ec720176a extend and refactor minor stuff in the framework
specifically add an argument to move/copy-to-edit so that it
does copy-only and export a function for trigger a submission
to the input port of a text:ports<%> object programmatically
2011-09-22 10:51:47 -05:00
Robby Findler
38596a9b58 manage the state for delegates better (used by the drracket contour window)
closes PR 12094
2011-08-07 18:39:22 -05:00
Robby Findler
29a843ac37 get rid of a broken attempt to optimize the 20,000-ft overview refreshing
closes PR 12083
2011-08-03 09:58:23 -05:00
Robby Findler
524d533392 added edit-sequence when flushing the delegate updates 2011-06-17 15:46:52 +08:00
Robby Findler
24d11805ac attempt to try to make the contour window feel faster by delaying the work until nothing has happened for 250 msec 2011-06-17 12:43:14 +08:00
Jon Rafkind
576916d4d7 line numbers separator uses the same color as the text 2011-04-04 13:07:25 -06:00
Robby Findler
8e94ce49e4 lift the restriction that the text:ports mixin
cannot do io from the eventspace handler thread
and add a test suite for text:ports
2011-02-15 18:10:02 -06:00
Jon Rafkind
5bb72d5b0e use the standard editor style to get the right colors in the line
numbers mixin. closes pr11655
2011-02-09 14:36:58 -07:00
David Van Horn
760a58b65d Fixes more spelling errors. 2011-02-04 19:44:13 -07:00
Matthew Flatt
96fd11eede DrRacket line numbers: fix condition for whether to draw a number 2011-01-28 06:22:28 -07:00
Robby Findler
71236aa48c make completions box handle clicking around a little bit better 2011-01-25 20:58:50 -06:00
Robby Findler
f182d0def4 drop superflous dependency on srfi1 2011-01-25 20:58:47 -06:00
Robby Findler
e0703e251b fix sizing and font inconsistencies in the completions box 2011-01-25 20:58:44 -06:00
Robby Findler
7a85e942a2 fixes the way alt-enter in the drracket repl works so that it doesn't insert whitespace into the submitted expression
closes PR 11621
2011-01-15 16:02:23 -06:00
Robby Findler
d2cb96bcb3 setup hooks so that the behavior of the home / c:a keybinings delegates to a method to find where to go
then, use that to change how it works for the scheme mode (and also another variation for the REPL to
cope with the prompt)

I spent a while trying to make this work at the keymap% level (ie putting different keybindings for "home"
and "c:a" into different keymaps) but this just turned out to be far too confusing and fragile, so went
with this alternative (one keybinding, but that delegates to an overridable method)

closes PR 11446
2011-01-09 16:22:28 -06:00
Robby Findler
ad47d346ba move the text class creation calls back to the end of the file 2011-01-09 15:38:24 -06:00
Matthew Flatt
9d7a7a1520 line number fixes
- restore some method augments that I shouldn't have deleted
 - handle font change through a style-list callback
2011-01-07 13:02:33 -07:00
Matthew Flatt
be6ba896e0 repairs for line numbers in DrRacket 2011-01-07 11:57:50 -07:00
Robby Findler
21050c2454 remove now useless private field 2011-01-06 10:09:09 -06:00
Robby Findler
c94ad960ac ask about normalizing pastes only after pasting has finished (in case there are multiple calls to insert)
closes PR 11449
2011-01-06 08:39:32 -06:00
Matthew Flatt
c9d2f43398 fix line-number mixin 2011-01-05 09:57:33 -07:00
Jon Rafkind
6c3feabb52 restore dc state after calculating the clipping area 2011-01-04 22:24:36 -07:00
Jon Rafkind
d7ac9c4399 sest the line number padding when the editor changes. calculate the position to draw at better 2011-01-04 22:16:52 -07:00