Commit Graph

530 Commits

Author SHA1 Message Date
Allan Odgaard
c8e42111c8 Use custom code instead of oak::c_array
This is a continued effort to track down the crash mentioned in commit 45fdb380ea.

In retrospect, the previous commit didn’t fix anything, as the temporary string object should be valid until the function has returned and there has been a few crash reports listing the function, though the frequency seems to have been decreased dramatically.
v2.0-alpha.9311
2012-09-18 22:57:33 +02:00
Allan Odgaard
44916a8a7f Add preliminary bundle install support. 2012-09-18 22:57:33 +02:00
Allan Odgaard
c7b90e4689 Checkin release notes 2012-09-18 22:57:03 +02:00
Allan Odgaard
b049dd8892 Opening folder sets up window title/scope attributes 2012-09-18 22:57:03 +02:00
Allan Odgaard
1b8255db06 Fix x-insert dialog command 2012-09-18 21:53:53 +02:00
Ryan Maxwell
c24f365daa Use curly quotes in dialog text 2012-09-18 20:28:07 +02:00
Allan Odgaard
536ea62f2d The indent ignore fold pattern would affect start/stop markers
When we wish to (ab)use the indented fold system to fold sections in markup languages we set the ignore pattern to ignore all but the heading markers. Some markup languages also have markup that might be suitable for folding with explicit start/stop markers, previously these were ignored, if matched by the ignore pattern.

This is an incomplete fix as we don’t correctly nest a start/stop marked block inside a section (the section will stop at the fold start marker).
2012-09-18 20:27:49 +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
8964971e98 Remove document_t::path_attributes 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
5e453d1172 Accept directory in file::path_attributes
This is so that we can get SCM system, build system, and similar.
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
1ecf3dabd3 fixup! Update project properties
Lost the framework in the window title.
2012-09-18 17:33:02 +02:00
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