Commit Graph

1488 Commits

Author SHA1 Message Date
Allan Odgaard
ee43777c3a Use GCD to perform concurrent rule matching 2013-08-18 17:29:29 +02:00
Allan Odgaard
3ae9bfe7b8 Collect active rules before performing any matching 2013-08-18 17:29:29 +02:00
Allan Odgaard
4677a91fff Factor out resolving of included rules 2013-08-18 17:29:29 +02:00
Allan Odgaard
019c911e9a Use tree structure icon for ragel, protobuf, and cap’n proto 2013-08-18 17:29:29 +02:00
Allan Odgaard
5c02b4ff5c Use cap’n proto for bundle index
This makes loading time roughly twice as fast, although some of the speed gain is because we no longer need to convert CFPropertyListRef → plist::any_t.
2013-08-18 17:29:29 +02:00
Allan Odgaard
4080e1dc96 Add support for serialization of cache_t with cap’n proto
See http://kentonv.github.io/capnproto/install.html for how to install.
2013-08-18 17:14:23 +02:00
Allan Odgaard
5d5399ecd9 Add member data accessor for cache_t’s content filter function 2013-08-16 22:40:09 +02:00
Allan Odgaard
4edca13ca1 Add assertion for grammar construction 2013-08-16 22:40:09 +02:00
Allan Odgaard
6a4fe2fb3c Add date parsing to plist::parse_ascii 2013-08-16 22:40:09 +02:00
Allan Odgaard
bf1e92b865 Do not use global constructors for fixtures 2013-08-16 22:40:08 +02:00
Allan Odgaard
e0ad0ba510 Use dispatch_time_t instead of std::chrono::time_point
Building with clang 3.2 (binary distribution) results in “illegal instruction” when adding 3 seconds to the steady clock, so I just replaced the code.

The reason the code was using std::chrono was to be able to provide better debug output, as dispatch_time_t is an abstracted time representation (according to the documentation).
2013-08-16 22:40:08 +02:00
Allan Odgaard
67c3a92855 Add some const keywords 2013-08-16 22:40:08 +02:00
Allan Odgaard
0bcae7957e Minor speed improvement in creating bundle index 2013-08-16 22:40:08 +02:00
Allan Odgaard
e8bbcaf76e Improve speed of loading (parsing) bundle index 2013-08-16 22:40:08 +02:00
Allan Odgaard
36c5dbba6b Make dictionary map function optional for cache_t::load 2013-08-16 22:40:07 +02:00
Allan Odgaard
7350192d51 DFA nodes themselves should not dispose children
A DFA node may be disposed as part of DFA construction (because the node is redundant) and here it would have “next” pointers setup, which it should not follow in its destructor, since those nodes could still be used.

Fixes #1086
2013-08-14 10:41:30 +02:00
Allan Odgaard
28594e0c18 Don’t pass NULL_STR to path::entries 2013-08-14 10:41:30 +02:00
Allan Odgaard
df42c5e638 When rescanning a non-existing bundle item path, rescan parent
For example when creating a new bundle (‘foo.tmBundle’) and then saving a new snippet in this bundle (‘bar.tmSnippet’) we may ask to rescan the ‘Snippets’ folder (in the bundle) before the bundle itself does a content (re)scan, which effectively makes the ‘Snippets’ rescan a no-op.

Should fix #1034
2013-08-14 10:41:30 +02:00
Allan Odgaard
9eeda712df Limit code duplication 2013-08-14 10:41:30 +02:00
Allan Odgaard
41b4f03712 Let gutter view observe frame changes from OakTextView
Previously it would only observe NSViewBoundsDidChange from the clip view containing the text view, and while it worked most of the time, it failed to see notifications when a text view was smaller than the clip view’s view port and grew, yet still staying smaller than the view port.
2013-08-12 23:49:00 +02:00
Allan Odgaard
5512d65ecf Remove some commented debug output blocks 2013-08-12 22:57:57 +02:00
Allan Odgaard
f7b9694e9f Fix linear destruction of DFA
This is a graph (not a tree) so we have to watch for cycles.
2013-08-12 22:57:57 +02:00
Allan Odgaard
22abe6d74f Disallow curl from using signals
If libcurl is built with the default DNS resolver then it will handle a timeout by using SIGALRM, though since we are using threads, and signals are not compatible with threads, this may have led to a crash in Curl_resolv_timeout (for users where a DNS lookup could take longer than the timeout, presumably 300 seconds).
2013-08-12 22:57:57 +02:00
Allan Odgaard
772143088a Rework code to avoid strange crash
I’m seeing a crash in ‘-[OakDocumentView dealloc]’ stating that “selectionString” is not being observed. This would indicate that a OakDocumentView instance is created that doesn’t go through the designated initializer, how that can happen is beyond me, but with the reshuffled code, if it happens, it should no longer cause a crash in dealloc.
2013-08-12 22:57:57 +02:00
Allan Odgaard
a68d206468 Add more info to crash reports 2013-08-12 22:57:56 +02:00
Allan Odgaard
a52165694c Move crash reporter info support to own framework
This is to avoid cyclic dependencies since it was previously in a somewhat high-level framework, so everything that framework depended on, could not augment crash reports.
2013-08-12 19:32:23 +02:00
Allan Odgaard
a74bfcc206 Remove some uses of foreach() 2013-08-12 19:32:23 +02:00
Allan Odgaard
b25f716f86 Remove rforeach macro 2013-08-12 19:32:23 +02:00
Allan Odgaard
c080bd8f8b Add storage access info to crash reports 2013-08-10 13:43:59 +02:00
Allan Odgaard
f008c49dab Dispose tree structure bottom-up to limit stack usage
With really long search strings, the recursive disposal of nodes would blow the stack
2013-08-10 13:14:55 +02:00
Allan Odgaard
231f1f8160 Improve application specific data in crash log
This makes it easier to automatically extract and index.
2013-08-10 11:55:39 +02:00
Allan Odgaard
7fa1d96faa Fix crash when “close tabs” is sent to window with no tabs
It appears a window can hang around after its last tab has been closed. Such window receive notifications of items being deleted via the file browser, and will call the “close tabs” method in response to these, which does an out-of-range array access if no tabs exist.

The reason for why windows can hang around after last tab is closed has not yet been determined. It might be a retain cycle (bug) or a delayed release due to autorelease pools.

Fixes #1064
2013-08-10 11:41:40 +02:00
Allan Odgaard
f17f49e95d Spelling suggestions can be chosen with 1-n 2013-08-10 00:51:27 +02:00
Allan Odgaard
21d68ce336 Fix file browser menu item validation 2013-08-09 23:21:21 +02:00
Allan Odgaard
e9576e60f9 Let transpose detect and swap words
The detection is done by a regexp match of ‘\w+\W+\w+’ allowing the string to optionally be wrapped in round, square, or squiggly parentheses.
2013-08-09 23:13:58 +02:00
Allan Odgaard
d311405af0 Harmonize code
We effectively do the same thing 5 different places, so good if the code is identical (incase it needs to be revised).
2013-08-09 22:20:23 +02:00
Allan Odgaard
5e5bbc468f Revert "The 10th tab now get ⌘0 as key equivalent"
This commit made the 11th tab get ⌘1 as key equivalent. Fixes #1078.

This reverts commit 5e6cfe8e1e.
2013-08-09 21:56:02 +02:00
Allan Odgaard
00c5f8531e Make outlineView:shouldExpandItem: a no-op for expanded items
Fixes #160.
2013-08-09 21:54:12 +02:00
Allan Odgaard
1c783fede9 Use implicitly synthesized properties 2013-08-06 15:00:04 +02:00
Allan Odgaard
1d4358fac6 Remove unused include 2013-08-05 18:55:43 +02:00
Allan Odgaard
97ad8294a6 Initialize shared spell checker during setup
The first time we ask for the shared spell checker it does some setup involving AppKit (creating the shared spelling panel?). While we already ensure that the spell checker is only called from the main queue, it seems this setup code must run on thread 0, which, when we are not in a Cocoa application, is not necessarily the thread used for the main queue.
2013-08-05 18:55:43 +02:00
Allan Odgaard
82e7749546 Explicitly run libcurl’s global init function
This function is not thread safe so we should not have it implicitly called, as we generally do not call the libcurl functions from the main thread.
2013-08-04 22:18:30 +02:00
Allan Odgaard
cd8b554b59 Ensure NSSpellChecker methods are called from main queue
I have been told that the spell checker should be thread safe (except for the spelling panel) but after moving to concurrent execution of the integration tests, several segmentation faults have pointed toward the spell checker not being thread safe.
2013-08-04 22:15:34 +02:00
Allan Odgaard
993bcaa26f Fix assertion (off-by-one) 2013-08-04 19:40:36 +02:00
Allan Odgaard
f4828036fe Preserve document’s scroll offset when changing soft wrap or font
Technically we preserve which line is the first visible.

Fixes #993.
2013-08-04 15:18:40 +02:00
Allan Odgaard
faf30e4786 Update document dimensions before restoring scroll position
Since the document starts out the same width as the view port, horizontal scroll position was effectively never restored, fixes #605.
2013-08-04 14:40:27 +02:00
Allan Odgaard
2c0010a141 Restore “first visible character” instead of visible rectangle
This is when switching tabs ore re-opening a file.

Restoring the visible rectangle doesn’t always work because we do an initial heuristic layout where we don’t do proper soft wrap and may also lack scoped settings to increase font size for headings, meaning that the restored visible rectangle does not point to the same section of the text, as it would with a fully updated layout.

This fixes #243.
2013-08-04 14:36:45 +02:00
Allan Odgaard
d9b446dcc2 Update some use of the iterate macro to for(… : …) 2013-08-03 17:44:30 +02:00
Allan Odgaard
c460535cf7 Add some debug output to layout_t 2013-08-03 17:30:13 +02:00
Allan Odgaard
3c1fe38190 Use a capturing lambda function instead of global variable
The code involved is only for debug output.
2013-08-03 17:25:42 +02:00