Commit Graph

786 Commits

Author SHA1 Message Date
Allan Odgaard
f294324df1 fixup! Make HTML output window a panel v2.0-alpha.9339 2013-01-09 07:16:55 +01:00
Allan Odgaard
edd966429e Remove tmCommand load/save converters 2013-01-09 07:15:15 +01:00
Allan Odgaard
b81588140d Checkin release notes 2013-01-09 07:08:58 +01:00
Allan Odgaard
362bf74fd9 Provide fallback search folder for non-project windows 2013-01-09 06:48:03 +01:00
Allan Odgaard
03398ed9e6 Insignificant source file touchup 2013-01-09 06:48:03 +01:00
Allan Odgaard
494c836217 Add (unused) code to prune tab bar 2013-01-09 06:48:02 +01:00
Allan Odgaard
6d46ba5363 Disable Go → Project Folder when unavailable 2013-01-09 06:48:02 +01:00
Allan Odgaard
772e7ae1b4 Use weak pointer for file browser’s delegate 2013-01-09 02:59:18 +01:00
Allan Odgaard
e13d531d70 Render glyphs in Unicode’s “private use area”
Previously we would render these with their code point value but since there are probably a few hundred glyphs available (on OS X) in the private use area, it was a disputed choice.
2013-01-09 02:59:18 +01:00
Allan Odgaard
aa59684c7e Rework document controller
While I have tried to keep most of the functionality the same (to get functional changes spelled out in the commit history) there are some significant changes:

When you open a folder or document(s) a default project folder will be based on the path(s) opened. This means that as long as you always open the root of your project (via `mate`, `open -a TextMate`, dragging the folder to TextMate, using the favorites (⇧⌘O), open dialog, `txmt:` URL scheme, or what have you), your project no longer require a `.tm_properties` file setting `projectDirectory` for Find in Folder (⇧⌘T), Go to File (⌘T), and similar to work as desired. Additionally the default properties now set a window title that include the project folder’s name (and SCM branch when available), so most projects can now also drop setting `windowTitle`.

Furthermore the file browser (for when opening documents) will default to the project folder rather than the folder set in Preferences (the latter is still used if there is no document, e.g. after ⌘N or ⌃⌘N).

The default project folder, even for opening a single document, means that opening more documents from the same folder (via Finder or perhaps something that uses the same temp folder for the local versions (which `rmate` does)) means that the following documents will open as tabs in the already open window (containing the first one opened). I _think_ this takes care of the common request of having all documents opened appear in new tabs of the frontmost window.

For managing tabs the ‘Merge All Windows’ action now ignores minimized windows. This means that if you wish to only merge a few windows then you can minimize all but those you wish to merge and then perform the action.

This commit should also address issue #117 (closing window’s last document via the file browser closes the entire window). Canceling a file open also no longer causes the entire window to close, but there’s still some work to do in this department (actually backtracking to previous state, which could mean closing the window if the window was opened only to show this document).

Prior to this commit the tab bar would be automatically pruned when overflowing, this is no longer the case, though this functionality should return.
2013-01-09 02:43:41 +01:00
Allan Odgaard
8582b807a2 Improve support for percent escaped url parameters (txmt://)
Previously we would let NSURL parse the parameter and ask for the path component. This however does not support tilde as shorthand for the user’s home directory, and certainly not with TextMate 1.x’s questionable syntax (using ‘file://~/«file»’ instead of ‘file://localhost/~/«file»’ or possibly ‘file:///~/«file»’ although this one seems a little wrong).

As for percent escapes, the issue here is that if the URL parameter escapes slashes or colons, not decoding the URL parameter before creating an NSURL instance will fail (as the URL is malformed). If however we do decode percent escapes and the URL parameter contains spaces, then NSURL will also fail, as a URL with spaces is malformed.

So I ended up bypassing NSURL and check for a few variants of a ‘file://’ prefix (which is also what TextMate 1.x did).

This closes issue #602.
2013-01-09 00:28:17 +01:00
Allan Odgaard
84e75200e7 Use weak pointer to break retain cycle
After converting the OakFilterList framework to ARC the file chooser windows would leak and the disk-scanning wasn’t aborted when closing the window.
2013-01-08 22:48:09 +01:00
Allan Odgaard
58fed7a8c4 Let window title include project folder name
This is only if the project directory is actually set at the time the default properties are expanded, so presently this has no effect (but will when TextMate sets a default value for the projectDirectory variable).
2013-01-08 22:48:09 +01:00
Allan Odgaard
2f2cce3f3e Add ‘uuid’ to txmt URL scheme
This can be used to link to the “current document” even if that document has no path. Previously this was done by leaving out the ‘url’ parameter, which made it target the frontmost document — using ‘uuid’ is a more robust way to achieve the same.

A command can read the TM_DOCUMENT_UUID environment variable for the current document’s identifier.
2013-01-08 22:48:08 +01:00
Allan Odgaard
821be6acad Custom named documents don’t occupy an untitled counter
Previously if the custom name was set before the display name was requested, it would not allocate an untitled counter, but if set later, it would (effectively) not release the counter already allocated.
2013-01-08 22:48:08 +01:00
Allan Odgaard
56ec501907 Only grab ‘untitled’ token for user-created documents
We may use OakDocumentView in a context where we don’t immediately assign it a document, or we wish to “overwrite” its default document with an untitled document that we create.

If the document view holds its own untitled document then the global counter includes that and the one we create is one higher than expected.
2013-01-08 22:48:08 +01:00
Allan Odgaard
357bc92980 Let buffer_t[size()] return empty string
Previously this was undefined, yet some code could trigger it. E.g. asking for the OS dictionary pop-up with an empty document.

I wasn’t sure if this should actually be allowed but decided that since operator[] returns strings, the “end of buffer” code point is easily defined as an empty string makes the code using this API simpler.
2013-01-08 22:48:08 +01:00
Allan Odgaard
03cf1fefb0 Make HTML output window a panel
This allows the main (document) window to handle menu keys (which are not handled by the HTML output window controller).
2013-01-08 22:48:08 +01:00
Allan Odgaard
987b12f694 Public API to make HTML output windows reusable 2013-01-08 22:48:08 +01:00
Allan Odgaard
ad4bb59ba5 Use to_s instead of UTF8String
This has the advantage of not causing a crash if the string object is nil.
2013-01-08 22:48:08 +01:00
Allan Odgaard
d4f664d4c8 Use factory method for DocumentController objects
We regularly iterate through all open windows and test if these are document controller windows. It will be easier to let the document controller class (or application delegate) manage a list of open document windows, as we anyway need some sort of owner with ARC (currently the instances own themselves and give up ownership in windowWillClose: which cause them to be released).
2013-01-08 22:48:07 +01:00
Allan Odgaard
203caea56d Watch if we leak ProjectLayoutView objects 2013-01-08 22:48:07 +01:00
Allan Odgaard
d96dbc4269 Clicking a ‘find all’ result would be handled twice
Normally this wouldn’t be noticed, as the second action would do the same as the first (go to the result in the associated project window), but when there was no project window a new window opens (to show the result), and that would be done twice.

This fixes issue #281.

There is still an issue with successive selections for the “no project window” situation, as each time, a new window is opened, rather than reuse the first one that opened.
2013-01-08 22:48:07 +01:00
Allan Odgaard
1a3c9d5db9 Add missing const qualifier 2013-01-08 22:48:07 +01:00
Allan Odgaard
e834b68343 Remove duplicate of public symbol 2013-01-08 22:48:07 +01:00
Allan Odgaard
5b9685fafa Remove unused method 2013-01-08 22:48:07 +01:00
Allan Odgaard
d082f38813 Make DocumentOpenHelper API block-based 2013-01-08 22:48:06 +01:00
Allan Odgaard
879cb2e777 Remove unused method 2013-01-08 22:48:06 +01:00
Allan Odgaard
a166ad481c Make OakSavePanel API block-based 2013-01-08 22:48:06 +01:00
Allan Odgaard
293d9a8e46 Ensure DisplayName doesn’t return nil
Although I don’t know when it would return nil, issue #649 indicates that it sometimes does. We now fallback on the full URL in this case (and returning ‘«nil»’ if the url itself is nil). This should give a hint about what file system entries would fail to return a display name.
2013-01-08 22:48:06 +01:00
Jacob Bandes-Storch
b277613ecd Add "Reveal Current Document" command
This reveals the current document in the file browser, by expanding directories to reach it, rather than changing the root directory of the browser.
2013-01-08 22:48:06 +01:00
Jacob Bandes-Storch
2162082f37 Move FS utility funcs from OFB to a separate file 2013-01-05 04:21:17 +01:00
Allan Odgaard
aa50c31636 Workaround for ruby’s YAML.load
JSON should be a subset of YAML so we use ruby’s YAML parser to parse GitHub’s JSON. This however leads to syntax errors reported by the parser (as noted in issue #637) but if the JSON is “pretty printed” it seems to parse it fine (seems to be the extra white space for associative array pairs).

We can trick GitHub into pretty printing the JSON result by setting the user agent to be curl, so that is all this workaround does.
2013-01-04 02:07:50 +01:00
Allan Odgaard
72c15833c5 Checkin release notes v2.0-alpha.9337 2013-01-03 21:26:04 +01:00
Allan Odgaard
3c32087595 Avoid weak pointers to NSViewController and NSWindowController
This is not supported on 10.7 (and leads to a crash).
2013-01-03 21:26:03 +01:00
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
37c2412e25 Remove Edit → Mode submenu
The menu item within is not hooked up to anything (as mentioned in issue #650) and as my idea for finishing the indent settings UI does not involve this menu item, I am removing it to avoid further confusion.
2013-01-03 01:16:54 +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
1aaab0c192 Happy new year 2013! 2013-01-02 01:46:48 +01:00
Allan Odgaard
9c35f445de Convert strings files to UTF-8 2013-01-02 01:46:48 +01:00
Allan Odgaard
5f635aa026 Build: Convert *.strings files to UTF-16 if needed
If the *.strings file does not contain an UTF-16 byte order mark (either big or little endian) then it is assumed to be UTF-8.
2013-01-02 01:46:48 +01:00
Allan Odgaard
074c20534e Improve debug logging 2013-01-02 01:46:48 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
8e937a7141 Require explicit import of OakFindProtocol.h 2013-01-02 01:46:48 +01:00
Allan Odgaard
8bcf126aba Minor refactoring 2013-01-02 01:46:47 +01:00
Allan Odgaard
93776ca9a1 Use Objective-C literals 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