Commit Graph

516 Commits

Author SHA1 Message Date
Allan Odgaard
565242584f Ensure document stays open in refresh helper
The refresh helper uses the document’s undo manager in its destructor. Normally the document would stay open throughout the duration of the scope in which the refresh helper is used, but it might be possible to close the current document from a nested event loop, as spawned e.g. by showing a tool tip, in which case, the document will be closed when we reach the destructor.
2012-09-18 17:33:01 +02:00
Allan Odgaard
2ef3d52a3d Remove unnecessary refresh from performKeyEquivalent: 2012-09-18 17:33:01 +02:00
Allan Odgaard
54bf2be75f Make variable const
Just to stress that map is immutable.
2012-09-18 17:33:01 +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
4ad00f7797 Avoid calling scope in completion functions
Instead we pass the scope as a parameter.
2012-09-18 17:33:00 +02:00
Allan Odgaard
19ef687334 Preserve arguments for recursive call to self 2012-09-18 17:33:00 +02:00
Allan Odgaard
130d0a168d Move check for indent corrections to OakTextView
This makes it easier to introduce a UI setting for the option.
2012-09-18 17:33:00 +02:00
Allan Odgaard
08666a37ba Fix type error 2012-09-18 17:33:00 +02:00
Allan Odgaard
8f7346ee3e Reset potential column selection cursor on caret blink
Sometimes the cursor gets stuck and there is really no workaround other than periodically reset the image.
2012-09-18 17:33:00 +02:00
Allan Odgaard
ebbd58c513 Improve build file dependency tracking
Previously if we did something like:

    CP_Resources = resources/*

The build file would correctly depend on the ‘resources’ directory, but a change, as in, adding, removing, or renaming a file, in a directory below ‘resources’ (e.g. adding ‘resources/English.lproj/NewWindow.xib’) would not correctly update the build file to include the new resource.
2012-09-17 16:42:42 +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
65c9594ff6 fixup! Let cf::to_s(NULL) return NULL_STR
Incase of an empty string CFStringGetBytes() returns 0 which we treated as an error. This caused empty strings to be turned into the NULL_STR placeholder.
2012-09-17 11:06:57 +02:00
Allan Odgaard
0810f5e34d Checkin release notes 2012-09-16 18:00:35 +02:00
Allan Odgaard
a45c2f6ea9 Improve “is scope selector” heuristic
A root scope can also be followed by a comma, e.g. “text, source”.
2012-09-16 18:00:35 +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
1a1a80629c Update README
Link to prebuilt binaries, mention 10.6 fork, libc++ requirement, boostdir variable, and the potential need for using xcode-select.
2012-09-16 12:05:34 +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
13ba42f98d Fix setting file type for dot files
When we store a file type for a dot file we should not prefix the “extension” with an asterisk.
2012-09-16 11:41:24 +02:00
Allan Odgaard
45fdb380ea Extend std::string’s lifetime for safe use of c_str
20% of reported crashes are in launch_tbz which indirectly call oak::c_array. My hunch is that the c_str buffer is overwritten because the std::string which returned it has been disposed, this makes strdup() do a bad allocation / memory read.

This would likely be a race condition (wrt. the c_str buffer) and coincidentally the oak::c_array is called in a thread (when it crashes).
2012-09-16 11:41:24 +02:00
Allan Odgaard
22c38ebe11 Remove legacy code (10.4 compatibility)
The code itself was using Gestalt() to check OS version which is deprecated on 10.8.
2012-09-16 11:41:24 +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
923dab6375 Scoped properties are now applied last
This is so that a global setting for ‘source.ruby’ takes precedence over a local ‘source’ setting.

A minor downside is that a local properties file cannot use scoped settings outside a scope selector section.
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
ec4ac60ae4 Add glob test: ‘*.ext’ doesn’t match ‘.ext’
I wasn’t sure if this was really desired, but it mimics bash.
2012-09-16 11:41:23 +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
2d2e329cd8 Remove legacy code 2012-09-15 15:12:58 +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
31fc37edbc Remove unnecessary include 2012-09-15 15:12:57 +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
926dfeb2a5 Auto-layout: Encapsulate tab bar expansion
With auto-layout the tab bar view can simply invalidate its intrinsic size when it should expand/collapse. This is also done if the global user setting for disabling tab bar collapsing is changed.
2012-09-15 15:12:57 +02:00
Allan Odgaard
e721e6e0d6 Ensure builddir doesn’t contain removed files
If e.g. we rename “image.tiff” → “image.png” then the build files are correctly updated to copy “image.png” to the build directory, but until this commit, the old tiff image would stay in the build directory until manually removing it / cleaning the build directory.
2012-09-14 17:14:56 +02:00
Allan Odgaard
5f24a91d44 Auto-layout: Update OakDocumentView
The gutter will invalidate its intrinsic size when its width changes which will cause the Cocoa layout engine to update the layout, so no more explicit code to deal with adjusting the gutter’s width.

Likewise, the height of the gutter (not the gutter scroll view) has been setup to match the height of the text view (again, not the containing scroll view). This avoids observing the text view frame and manually updating gutter height to match it.
2012-09-14 17:14:56 +02:00
Allan Odgaard
6bb23c1765 Gracefully handle missing gutter view delegate 2012-09-14 17:14:56 +02:00
Allan Odgaard
339c582f8c Auto-layout: Update incremental search (xib) 2012-09-14 17:14:55 +02:00
Allan Odgaard
2b9c27263d Auto-layout: Update file browser and HTML output 2012-09-14 17:14:55 +02:00
Allan Odgaard
4d95db8f66 Auto-layout: Implement intrinsicContentSize 2012-09-14 17:14:55 +02:00
Allan Odgaard
a621a23924 Update project properties
Mainly just rely on default SCM window title.
2012-09-14 17:14:55 +02:00
Allan Odgaard
539f16008e Include SCM info in default window title
Ideally I also wanted to include project directory, but since the user’s properties are read after the default ones, and those contain the setup of projectDirectory, this isn’t possible with the current semantics.
2012-09-14 17:14:55 +02:00
Allan Odgaard
170785dd52 Fix typo 2012-09-14 17:14:55 +02:00
Allan Odgaard
2e3af12381 Rename property: layout → layers
This is to avoid a clash with the layout method introduced in 10.7 (and used during auto layout).
2012-09-14 17:14:55 +02:00
Allan Odgaard
144ee3762d Use NSBox to draw gutter divider
There’s a few subtle advantages of going with a view, mostly theoretical (about minimizing refresh rectangles) but switching to constrained based layout should provide minor code simplifications, since our ancestor view won’t have to deal with the gutter divider rectangle.
2012-09-14 17:14:54 +02:00
Allan Odgaard
2b2b0b016d Make all second level headings article 2012-09-14 17:14:54 +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
ba28b9e1ae Set TM_APP_IDENTIFIER
This is for bundles that need to read TextMate’s preferences file (should only be those using a nib with user defaults bindings for their preferences dialog).
2012-09-12 18:30:37 +02:00
Allan Odgaard
04272337ae Let cf::to_s(NULL) return NULL_STR
This was previously undefined. We also return NULL_STR when converting the CFString fails.
2012-09-12 18:30:37 +02:00
Allan Odgaard
065f5552bb Enable implicit @synthesize
I haven’t removed the current use of @synthesize since that results in a build that throws exceptions and crashes.
2012-09-12 18:30:37 +02:00