Commit Graph

3539 Commits

Author SHA1 Message Date
Allan Odgaard
64b03394e9 Checkin release notes v2.0-beta.8 2015-09-16 08:35:15 +02:00
Allan Odgaard
10b1f3bfea Always clear SCM info when changing document
For a project window where only some tabs are under version control, switching from one tab with version control info, to one without, would use the info from the previous tab with the new one (proxy icon badge and scope attributes).
2015-09-10 14:24:28 +02:00
Allan Odgaard
b6a7529d97 Bind tab size dialog to OakDocumentView instead of OakTextView
This ensures the setting is saved and also (sort of) follows the principle of least knowledge.
2015-09-10 14:20:51 +02:00
Allan Odgaard
871e013ed9 Add tabSize property to OakDocumentView
Going via this property ensures that the setting is saved.
2015-09-10 14:19:10 +02:00
Allan Odgaard
b1fa6524cb Save with Xcode Version 6.4 (6E35b) 2015-09-10 13:06:36 +02:00
Allan Odgaard
a99acf8532 fixup! Ensure we re-use file browser items that are unchanged v2.0-beta.7.12 2015-09-07 20:15:10 +02:00
Allan Odgaard
98571f90ee Update Onigmo submodule v2.0-beta.7.11 2015-09-07 18:27:16 +02:00
Allan Odgaard
c038bbe7bc Ensure we re-use file browser items that are unchanged
The data sources should already re-use items, as they are passed the old items, but since data sources are multi threaded, there might perhaps be a situation where the items passed gets updated out-of-order and re-use isn’t perfect (I haven’t been able to confirm this).

Re-using the items, when we use the animation methods of the outline view, does however seem to be very important, because the outline view will neither copy nor retain the items returned from our data source, so we must ensure they stay retained until we have told the outline view that the item no longer exist, so replacing an item with one that is equal but not pointer identical, without notifying the outline view, will cause random crashes.

At least that is my theory.
2015-09-07 18:16:58 +02:00
Allan Odgaard
7e396fae6f Open all selected items on double click and Open menu action 2015-09-07 18:16:58 +02:00
Allan Odgaard
51edc48bea Checkin release notes 2015-09-07 18:16:58 +02:00
Allan Odgaard
4484eb0de3 Remove unused method 2015-08-30 10:55:18 +02:00
Allan Odgaard
975fd70779 Re-encode redundantly encoded multi-byte sequences
If our buffer contained such sequences then an exception could be thrown when creating an NSString representation, for example copying to the system clipboard or displaying search results in the UI.
2015-08-30 10:53:24 +02:00
Allan Odgaard
09294626fe Use stringWithCxxString: instead of calling c_str
The problem with the latter is that a C string is null terminated, but we might have null characters in our string.

Furthermore, the stringWithCxxString: can do a little extra work, like check if the string is NULL_STR or (after next commit) fix redundantly encoded multi-byte sequences.
2015-08-30 10:52:56 +02:00
Allan Odgaard
7400fb63ad fixup! Use empty last line from commands working on multiple selections
We only use the last empty line when there are more than a single line break in the string to be inserted.

The use-case here is having multiple carets and then running a command like “echo foo”. Here we receive “foo\n” which is split into (“foo”, “”), so every second caret would get the empty string inserted.
2015-08-27 23:02:17 +02:00
Allan Odgaard
c603b83050 Don’t use “entire document” fallback input with multiple carets 2015-08-27 22:58:56 +02:00
Allan Odgaard
d02421670f Don’t skip sanitizing ranges when input is “entire document”
Incase there are multiple carets, we’ll get multiple “entire documents” ranges.
2015-08-27 22:55:03 +02:00
Allan Odgaard
f06f447ede Avoid referencing private types by using std::remove_pointer 2015-08-27 22:46:53 +02:00
Ronald Wampler
2c6ad9b391 Disable unused-local-typedef warning for sparsehash
Also, disable unknown-pragmas warning for older version of clang.
2015-08-11 21:01:07 +02:00
Ronald Wampler
ac56d6e896 Move OakFlagState enum declaration out of method
Also, changed the `newFlagState` property to use the enum type.
2015-08-11 21:01:07 +02:00
Ronald Wampler
14c6a70b85 Use our own lightweight wrapper for thread local storage
With the boost thread helper we have to statically link to the boost libraries, which on most system is built against the latest version of the OS (instead of our current target 10.7). This doesn't seem to be an actual problem, but newer versions of clang issue warnings about it.
2015-08-11 21:01:07 +02:00
Ronald Wampler
f3d1abaeca Introduce tls_ptr_t
This is a lightweight wrapper around the pthread methods to access thread local memory.
2015-08-11 21:01:07 +02:00
Allan Odgaard
60050cf026 Add Export Bundle… to bundle editor’s context menu v2.0-beta.7.8 2015-08-08 11:35:23 +02:00
Allan Odgaard
c259dd582b Add API to save bundle item to arbitrary location 2015-08-08 11:34:55 +02:00
Allan Odgaard
3acd714402 Refactor 2015-08-08 11:34:35 +02:00
Allan Odgaard
70b830b557 Add API to skip resolving proxy items when querying bundle items
This is useful for obtaining a list of “physical” bundle items in a bundle.
2015-08-08 11:34:06 +02:00
Allan Odgaard
05e087f087 Use view-based table view in pop-up menu usable from snippets
Starting with 10.10 (I think) the text was no longer drawn in the proper highlight color. Switching to a view-based table view fixed that issue.
2015-08-08 11:34:06 +02:00
Allan Odgaard
6b387eea6e Implement setNilValueForKey:
When running a debug build we get an exception due to lacking this method and the documentation does seem to indicate this is required for scalar keys.
2015-08-05 12:32:40 +02:00
Allan Odgaard
068855b4e0 Disable deprecation warning for API working on resource forks
There doesn’t seem to be any replacement API for this so while the warning (when building with the 10.8 SDK) may serve as a reminder to update the code, the only possible update I can see is to drop support for reading text clippings.
2015-08-05 12:32:06 +02:00
Allan Odgaard
8fe7681ebd Remove unnecessary include of oak/compat.h 2015-08-05 12:31:20 +02:00
Allan Odgaard
d1ed42fef1 Use isOperatingSystemAtLeastVersion: to check for 10.10
The method wasn’t public before 10.10 but since we need to check for 10.10 we can simply conclude that lack of this method means that we are not running on 10.10.
2015-08-05 12:29:33 +02:00
Allan Odgaard
c75b89c048 Avoid temporary CFStringRef when creating file system CFURLRef 2015-08-05 12:29:24 +02:00
Allan Odgaard
6ffd12e805 Improve algorithm to find root when using reveal in file browser
The algorithm will avoid changing root when possible. If root has to be changed, we favor the current project folder, if that is not possible, we use the parent for the item being selected, unless the item is in a file package below the project folder, in that case, we use the root of the file package.
2015-08-05 12:29:12 +02:00
Allan Odgaard
d550eae4a0 Remove legacy code for relaunching already running instance 2015-08-05 12:28:07 +02:00
Allan Odgaard
b2c76df2da Fix incorrect type declaration 2015-08-05 12:27:06 +02:00
Allan Odgaard
82e5e14ae1 Remove unused function: is_trashed
The intent was to use this to decide if the proxy icon should be hidden but the API used by the function is deprecated on 10.8.
2015-08-05 12:26:17 +02:00
Allan Odgaard
7d9b2d5470 Unbind properties when disposing our view
Since we dispose the subviews that the bindings are hooked up to, this shouldn’t be necessary, but it’s good for symmetri.
2015-08-05 12:25:12 +02:00
Allan Odgaard
9efde6d41b Don’t place a caret when ⌘-clicking a selection 2015-08-05 12:24:39 +02:00
Allan Odgaard
b3478a2628 Use “modern” API to examine and resolve alias files 2015-08-05 12:23:35 +02:00
Allan Odgaard
34b374c185 Avoid two uses of FSRef (which is deprecated from 10.8) 2015-08-05 12:23:29 +02:00
Allan Odgaard
35e78feafc Check if we have an editor instance in input client methods
I’m seeing a few crashes where the most likely explanation is that input client methods are called either before setting up an editor instance, or after disposing it.
2015-08-05 12:23:06 +02:00
Allan Odgaard
0b70563c73 Add crash log info to track down a bug
Crash is in CFStringGetLength called from _CFURLCreateWithFileSystemPath, so it appears that some sort of malformed string can find its way to this call.
2015-08-05 12:22:50 +02:00
Allan Odgaard
15d57f7aed Checkin release notes v2.0-beta.7.7 2015-07-31 12:49:32 +02:00
Allan Odgaard
98206004dc Support fallback units for multiple carets
For example a command that works on selection but falls back to current word will now also work with multiple carets.
2015-07-31 12:37:29 +02:00
Allan Odgaard
755a9e1f7e Look at all carets to decide if there is a selection
Previously we only looked at the last caret, and if this one was not a selection then we would treat the multiple carets (selection ranges) as nothing being selected, and thus, a command replacing the carets, would not leave anything selected.
2015-07-31 12:18:53 +02:00
Allan Odgaard
3047212ed2 Use empty last line from commands working on multiple selections
When pasting or using Filter Through Command with multiple carets, we ignore a potential final empty line, this is because our text will be something like “foo\nbar\n” and we split on the newline, so we end up with (“foo”, “bar”, “”) and if we have more than two carets, then we insert the empty string for every third caret.

For a command though we expect there is a 1:1 between number of carets and newlines in the result, so we should never skip the last element.
2015-07-31 12:01:46 +02:00
Allan Odgaard
58bacfb763 Command with multiple selections would never select output
This now uses the same logic as with a single selection.
2015-07-31 11:48:56 +02:00
Allan Odgaard
0aa9cd8166 Don’t skip binary files when using Find All with open documents 2015-07-31 11:29:42 +02:00
Allan Odgaard
b440a8681f Remove OakImageAndTextCell class 2015-07-30 22:18:39 +02:00
Allan Odgaard
2a9220c570 Update dialog plug-in (add own image and text cell) 2015-07-30 22:18:07 +02:00
Allan Odgaard
f2387c9bc3 Ensure that the outline view’s clicked row is valid
The problem is if we right-click an item that causes content to be changed (e.g. Show Enclosing Folder) then later in the same run loop cycle ask for selected items, we prefer the clicked row, but this one might now no longer exist.
2015-07-30 22:00:06 +02:00