Commit Graph

37 Commits

Author SHA1 Message Date
Allan Odgaard
1c308c810d Use map::emplace instead of inserting std::pair (C++11) 2013-09-05 20:59:11 +02:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Allan Odgaard
f56e6ae36a Fix potential out of range access 2013-08-30 12:30:33 +02:00
Allan Odgaard
896416c3e9 Check pointer is initialized before using it
I see a few crash reports that indicate this code is called without a valid ‘bundleItemContent’, though unsure how to reproduce.
2013-08-25 21:13:06 +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
8b32837a39 Force cache invalidation when deleting bundle items
This is to workaround missing fs-events. Ideally the bundle item itself would do the cache invalidation, since it’s complicated to deduce what paths need rescanning after a delete.
2013-07-21 22:54:12 +02:00
Allan Odgaard
8b696444c6 Invalidate bundle item (disk) cache when saving in bundle editor
Normally the cache is automatically invalidated via fs-events, but that is sadly unreliable.

Should fix #1034.
2013-06-29 12:42:34 +02:00
Allan Odgaard
a2e7de29e7 Add missing include 2013-05-16 21:29:59 +07:00
Allan Odgaard
6e4926177e Provide symmetric content/set_content for document_t 2013-05-15 15:45:36 +07:00
Allan Odgaard
ce4ae62547 Change ‘variables_for_path’ API
We now accept the a directory in addition to the path. If a directory is provided, the path is only used to filter variables rooted at the directory.
2013-05-12 11:09:18 +07:00
Allan Odgaard
e49504a644 Remove unused member data 2013-05-06 14:51:32 +07:00
Allan Odgaard
26d3029ba0 Treat bundle items without path as modified
This allows us to create an in-memory bundle item, reveal in bundle editor, and have the bundle editor warn if the user doesn’t save.
2013-03-27 14:32:26 +01:00
Allan Odgaard
0f9b15b916 Show error when property list fails to parse 2013-03-17 15:44:07 +01:00
Allan Odgaard
5dcbbde817 Let user know if saving in bundle editor fails 2013-03-17 15:44:07 +01:00
Allan Odgaard
c459e0483f Remove compatibility check (10.5) 2013-03-04 13:33:38 +01:00
Allan Odgaard
2c6504b82f Use symbolic constants for binding properties 2013-03-03 15:53:05 +01:00
Allan Odgaard
06b60dc04e Show colorSpaceName entry in bundle editor
Also add this to the template for new themes (set to sRGB) and a default semantic class.
2013-02-18 15:38:27 +01:00
Allan Odgaard
e047d458fd Fix crash in bundle editor
I have added a check to ensure we have the bundle item content (in addition to the bundle item) which fixes #774 although it is unclear to me how the bundle editor would end up in a state where it has a bundle item but no content for that item. There is a window in the setBundleItem: method where the bundle item content hasn’t yet been setup, but commitEditing is not called during that window.
2013-02-11 14:21:20 +01:00
Allan Odgaard
32fcb52c68 Workaround for clang linker warning
Using instances with static storage in Objective-C files result in the following warning (starting with clang 425.0.24):

ld: warning: direct access in […] to global weak symbol […] means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
2013-02-02 08:52:12 +01:00
Allan Odgaard
04b092afb1 Move static data out of headers
This is to satisfy clang (421.0.57).
2013-01-29 15:28:23 +01:00
Allan Odgaard
0b9e591b7d Bundle editor was holding an untitled counter
This meant after opening the bundle editor the next untitled document created would have a number prefix one higher than expected.
2013-01-11 23:23:41 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
9e332438e7 Use block-based alert API 2013-01-02 01:46:47 +01:00
Michael Sheets
8bdbeacfcd Add indentOnPaste to ordering in bundle editor 2012-12-14 18:03:37 +01:00
Allan Odgaard
91903319be ARC: Update BundleEditor framework 2012-11-12 13:28:34 +07:00
Allan Odgaard
0f3861fec7 Retire custom begin/endof functions
We can now use std::begin/end although for containers we explicitly call the member functions.
2012-09-20 12:22:21 +02:00
Allan Odgaard
8fd7b82cbd Remove CocoaSTL.h include 2012-09-20 12:22:20 +02:00
Allan Odgaard
4532099359 Use Objective-C for…in instead of macro
This avoids having to use C++ iterators and we want to get rid of some of this Objective-C/C++ mixing for ARC and other reasons.
2012-09-20 12:22:19 +02:00
Ryan Maxwell
c24f365daa Use curly quotes in dialog text 2012-09-18 20:28:07 +02:00
Allan Odgaard
6477c32fda Expose gutterSettings when editing themes
Also fix the grammar used for theme and macro editing (meta.plist → source.plist).
2012-09-08 00:42:26 +02:00
Allan Odgaard
aa2b194341 Better ordering of keys when editing bundle items
This closes issue #338.
2012-09-03 21:52:44 +02:00
Jacob Bandes-Storch
dfdde3283f Use 64-bit: explicit visibility where required 2012-08-28 21:32:47 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Gerd Knops
d19e2fa49e BundleEditor: follow truncated names with ellipsis 2012-08-22 21:15:17 +02:00
Gerd Knops
7aa70dd581 Bundle Editor: allow selection of disabled items
Previously disabled items could not be selected, and hence not be re-enabled.
2012-08-18 21:28:55 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00