Commit Graph

83 Commits

Author SHA1 Message Date
Allan Odgaard
934ec2de5c Set window delegate to nil before we disappear
There are places where we iterate through the delegates of NSApp’s ordered windows. Since the window may stay around longer than it’s (NSWindowController) delegate, we should be sure to set NSWindow’s delegate property to nil.
2013-01-03 06:43:46 +01:00
Allan Odgaard
ecc25b38d4 Improve handling of session state
We now remember values like file browser history even if the file browser is not shown while saving session state (but has previously been, or state was provided during setup). We also use the file browser and HTML output sizes stored in the session info (previously we only used values from NSUserDefaults).
2013-01-03 05:47:42 +01:00
Allan Odgaard
371198729b Support HTML output placed on right side 2013-01-03 05:45:49 +01:00
Allan Odgaard
303ba070a4 Collapse two class extensions into one 2013-01-03 01:16:54 +01:00
Allan Odgaard
80379dcc06 Use auto-synthesized properties 2013-01-03 01:16:54 +01:00
Allan Odgaard
074c20534e Improve debug logging 2013-01-02 01:46:48 +01:00
Allan Odgaard
8bcf126aba Minor refactoring 2013-01-02 01:46:47 +01:00
Allan Odgaard
d9cf30986d Only expose instance variable to framework (@package) 2013-01-02 01:46:47 +01:00
Allan Odgaard
534df6e755 Remove implementation details from interface
The properties left in the interface are used with bindings so sort of public (as they are used “outside” the implementation file).
2013-01-02 01:46:47 +01:00
Allan Odgaard
079b762c42 Use block-based callback API 2013-01-02 01:46:47 +01:00
Allan Odgaard
9e332438e7 Use block-based alert API 2013-01-02 01:46:47 +01:00
Allan Odgaard
b84992bdb3 ARC: Update DocumentWindow framework 2013-01-02 01:46:46 +01:00
Allan Odgaard
3d45b788f1 Update block-based NSAlert API 2013-01-02 01:46:46 +01:00
Allan Odgaard
ef8994ee00 Use block-based notification API
This removes the need for a dummy observer object.
2013-01-02 01:46:46 +01:00
Allan Odgaard
2a3b442bf2 ARC: Update TextMate (core application) 2012-12-28 02:47:19 +01:00
Allan Odgaard
1791a48571 Fix potential crash when using “Edit Command…” button
The block used the ‘uuid’ variable, this variable was however a (const) reference, so it wasn’t safe to use within the block.

While fixing the bug (by introducing a local non-reference variable for the bundle item) we have also changed the code slightly, so that “Edit Command…” only shows when a bundle item is found (this is mainly in preparation for running shell commands that doesn’t have a bundle item, e.g. from a future “Filter Through Command” dialog).
2012-12-24 01:23:33 +01:00
Allan Odgaard
06d4b51f44 Fix memory leak
This was introduced when we introduced block-based alert sheets for command errors.
2012-12-24 01:22:29 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
71ec3d4c82 Add block-based show alert API 2012-12-16 21:27:06 +01:00
Allan Odgaard
4d8f0422ec Provide “More Info…” for unsatisfied command requirements
See issue #622 for more details.
2012-12-16 00:01:13 +01:00
Allan Odgaard
397dc877af Use a block-based wrapper for NSAlert
This code isn’t ideal: We should make it a function instead of a class and the ‘info’ property should instead be done using a captured variable.
2012-12-16 00:01:13 +01:00
Allan Odgaard
e1dd99a0f5 Add window to “document will save” notification
The text view needs to do a little work before saving a document (serialize folded text) and with the window as part of the user data, we can now skip that for text views in windows for which documents are not going to be saved.

This is not an ideal solution; long-term saving will be moved up to the DocumentWindowController which has the full view of all documents and text views.
2012-09-27 17:52:41 +02:00
Allan Odgaard
cf62b6e92b Improve error text for missing shell commands 2012-09-27 17:52:41 +02:00
Allan Odgaard
4ed34392d6 Use synthesized instance variables 2012-09-24 21:15:47 +02:00
Allan Odgaard
3f012ff11c Recent menu ignores files created with “New Tab” 2012-09-21 16:24:42 +02:00
Allan Odgaard
8fd7b82cbd Remove CocoaSTL.h include 2012-09-20 12:22:20 +02:00
Allan Odgaard
4273bf968b Get rid of C++ style NSIndexSet iteration 2012-09-20 12:22:19 +02:00
Allan Odgaard
22644470f8 Fix crash when clicking exactly on split view divider 2012-09-19 00:11:11 +02:00
Allan Odgaard
b049dd8892 Opening folder sets up window title/scope attributes 2012-09-18 22:57:03 +02:00
Ryan Maxwell
c24f365daa Use curly quotes in dialog text 2012-09-18 20:28:07 +02:00
Allan Odgaard
361d2daa5b Fix wrong document showing after session restore
Since documents are loaded asynchronously and we trigger a request for the first tab’s document, this might finish loading after the selected tab’s document, hence trigger a setDocument: after we loaded the selected document’s tab.
2012-09-18 19:38:01 +02:00
Allan Odgaard
48616a7ea1 Make document_t::scope private
Ideally should be removed entirely but as document presently does load/save where we need scopes (for import/export commands), we need it internally.
2012-09-18 19:38:01 +02:00
Allan Odgaard
79b0f7a14a Setup scope attributes for untitled documents
These are based on the potential save directory (i.e. the one showing in the file browser) and ensures pressing ⌥⌘N gives the new document proper project and SCM scopes (so ⌘Y and ⌘B works as expected).

This fixes issue #367.
2012-09-18 17:33:02 +02:00
Allan Odgaard
45763d4afc Don’t require file to get SCM info
We didn’t actually use the file itself, only its parent directory, and there are several places we want SCM info for an untitled file’s project directory, so removing the need for a file simplifies things.
2012-09-18 17:33:02 +02:00
Allan Odgaard
848d197f7a Use DocumentController over document_t 2012-09-18 17:33:01 +02:00
Allan Odgaard
c26e5c2d36 Scope attributes are now given to editor_t
While presently it works the same, it allows us to provide better scope attributes e.g. for untitled documents (which lack SCM attributes).
2012-09-18 17:33:01 +02:00
Allan Odgaard
dabcad588d Introduce OakTextViewDelegate 2012-09-18 17:33:00 +02:00
Allan Odgaard
08666a37ba Fix type error 2012-09-18 17:33:00 +02:00
Allan Odgaard
d5b4573694 Simplify closing tab/split action methods 2012-09-17 16:42:42 +02:00
Allan Odgaard
effa1577ac Don’t call setBottomCornerRounded:NO
This is private API and no longer seems necessary.
2012-09-17 16:42:42 +02:00
Allan Odgaard
d4f6cbacf3 Simplify code
If the window hadn’t been loaded yet, we previously had to delay opening the document when changing tab (in code).

Since we now create the window in the initializer, there is no longer need for this.
2012-09-16 17:03:03 +02:00
Allan Odgaard
7cd8ae4b8e Add safety checks
Since 10% of reported crashes are in synchronizeWindowTitle and seems to be about not having a proper document pointer, I am adding these checks and some debug output — don’t understand how we would get into this situation though.
2012-09-16 11:41:25 +02:00
Allan Odgaard
5ab65ea560 fixup! Constrain size of splits in main window
Forgot to enable ‘autorecalculatesKeyViewLoop’.
2012-09-16 11:41:24 +02:00
Allan Odgaard
d5a73dfca9 Don’t present dot files as having an extension
This is just for the dialog text when user is asked to select a file type.
2012-09-16 11:41:24 +02:00
Allan Odgaard
363ba94fb8 Fix format string in xib
Was using the (undefined) ‘Extension’ variable instead of ‘X’.
2012-09-16 11:41:23 +02:00
Allan Odgaard
1fafbecd54 Remove Chinese translation
It’s not feasible to maintain the old-style xib translations while we work on the UI. We’ll soon move fully to constraint-based layout which should allow translations to be purely string-based.
2012-09-16 11:41:23 +02:00
Allan Odgaard
84104c8d9b Constrain size of splits in main window
The main window has now moved fully to constraint based layout which makes it a lot easier to tweak the layout and fixes issue #145.

Presently the option to have HTML output on the right is not supported. It will likely be back with a few other options that have been requested.

The width of file browser and height of HTML output view is always read from defaults rather than restored from previous session. Effectively this results in the same behavior except when there are multiple windows with different sizing of these splits. Unsure if per-window sizes should be brought back.
2012-09-15 15:12:58 +02:00
Allan Odgaard
baae923414 Remove resize buttons
Going forward we only allow resizing views by grabbing the dividers.
2012-09-15 15:12:57 +02:00
Allan Odgaard
3d3e44e1a4 Add TM_CURRENT_THEME_PATH
There’s a few commands which want to read settings from the current theme. So far these have been reading the theme UUID from TextMate’s settings and scanned the disk to find the corresponding property list.

This is pretty bad because theme UUID can be set in different ways, themes can be in arbitrary bundles, and the property lists can be in delta format.

The latter is not solved, though we ensure the variable point to the base theme, incase a delta exist. TextMate could simply write a non-delta version of the theme to TMPDIR and let the variable point to that, so we’re not really limiting ourself by adding this variable.
2012-09-12 18:30:37 +02:00
Allan Odgaard
28f80a791d Use project’s window title settings for untitled documents
This includes setting up SCM variables and closes issue #298.
2012-09-11 00:05:05 +02:00