Commit Graph

4047 Commits

Author SHA1 Message Date
Allan Odgaard
0f90dfd4dd Explicitly set default values for bundle_command_t members 2016-08-28 13:32:48 +02:00
Allan Odgaard
c99e65b17c Let OakHTMLOutputView handle the “Stop Task?” warning sheet
This also allows for the sheet to automatically close, should the command exit before the user selects an action.
2016-08-28 13:32:47 +02:00
Allan Odgaard
2c41cf8fa0 Remove unnecessary code 2016-08-28 13:32:47 +02:00
Allan Odgaard
926786c36c Use NSURLProtocol’s setProperty:forKey:inRequest: for associated data
This simplifies our code though it seems like the lifetime of the data is much longer than the request it is associated with.
2016-08-28 13:32:47 +02:00
Allan Odgaard
0319186e89 Introduce a pipe when writing to the HTML output view
This removes the command::runner_t dependency from our custom URL protocol.
2016-08-28 13:32:47 +02:00
Allan Odgaard
349db77eba Make matched part of search results have a light grey background
The motivation for this was so that we can see if we match whitespace, e.g. searching for trailing whitespace using ‘[\t ]+$’ would not indicate how much whitespace we actually matched.
2016-08-28 13:32:47 +02:00
Allan Odgaard
a4b8abe73c Disable “tightening” of truncated match results
When we tighten the text then it doesn’t line up properly (especially line numbers) which looks off.
2016-08-28 13:32:47 +02:00
Allan Odgaard
817b2dc75e Remove attr_string_t class 2016-08-28 13:32:47 +02:00
Allan Odgaard
7844e50f5b Use string_builder_t instead of attr_string_t
Two minor changes:

- Matches now (correctly) use a font with monospace digits for all line numbers (not just first).
- Matches with ‘\r’ characters now have the replacement string (‘<CR>’) be bold if it is part of the match.
2016-08-28 13:32:47 +02:00
Allan Odgaard
c83e2e80ba Add helper class for building NSAttributedString
The existing ‘attr_string_t’ is a little inflexible in that it has to know how to handle each attribute type and also lack a way to push/pop styles, which means that in practice we have to reset styles when leaving a scope.
2016-08-28 13:30:30 +02:00
Allan Odgaard
b0cbae4353 Update dialog plug-in (HTML tooltip dimension rounding error)
Being off-by-one for the width could cause wrapping adding an entire extra line placed outside the viewport.
2016-08-28 09:56:56 +02:00
Allan Odgaard
5ff520a403 Add move semantics to storage_t 2016-08-28 09:17:59 +02:00
Allan Odgaard
96d322c298 Use close(open(path, O_CREAT)) to “touch” path 2016-08-28 09:16:10 +02:00
Allan Odgaard
b0ba62451d Remove path::touch_tree
This was previously used by the software updater to prevent the “temp cleaner” from removing a downloaded update, incase the user took their time to click the “Install & Relaunch” button.
2016-08-28 09:14:43 +02:00
Allan Odgaard
4294889a79 Add comments about scope attributes 2016-08-28 09:13:41 +02:00
Allan Odgaard
0638874b61 Tag code that can be retired when updating OS requirement
When bumping the minimum requirement we can do a search for MAC_OS_X to find all places where we have compatibility code.
2016-08-28 09:13:33 +02:00
Allan Odgaard
8709ee8f01 Make it obvious that our code is workaround for 10.8 2016-08-28 09:13:27 +02:00
Allan Odgaard
60ba4c9930 Introduce callback.document.will/did-reload 2016-08-28 09:11:34 +02:00
Allan Odgaard
0e963bafc1 Post will/did reload document notifications 2016-08-28 09:10:28 +02:00
Allan Odgaard
04c507a1f3 Expose all semantic classes for items in the bundle item chooser 2016-08-28 09:10:08 +02:00
Allan Odgaard
22c1162707 Add “Copy Replacements” to the Find dialog’s action menu
This will expand the replace (format) string using the captures of each match and copy each expansion to the pasteboard.

For example searching for `object->(\w+)\()` with replace set to `$1` will copy only the function name from each invocation.
2016-08-28 09:08:17 +02:00
Allan Odgaard
b4db4fc5d6 Checkin release notes for 2.0-beta.12.5 v2.0-beta.12.5 2016-08-25 10:41:50 +02:00
Allan Odgaard
0dbd7ff903 Introduce exit_insert_snippet_no_indent
By default a command with snippet output will have the snippet indented to the current indent level.

This can be disabled in the bundle item’s property list but there might be situations where we want to disable it dynamically.

For an example see http://lists.macromates.com/textmate/2016-August/039845.html
2016-08-25 10:10:58 +02:00
Allan Odgaard
29279118c3 Introduce symbolic name for last defined exit code 2016-08-25 10:10:33 +02:00
Allan Odgaard
7ae00f9436 Ensure we have a selection before local drag’n’drop (move)
Based on crash reports it would appear that users are able to trigger a local drag’n’drop (move) even when there is no selection.
2016-08-25 09:41:21 +02:00
Allan Odgaard
16de4dc07a Fix reversed logic
If the pruned ranges are empty we should use the original ranges, not the empty ones.
2016-08-25 09:41:21 +02:00
Allan Odgaard
a1c5ff8b17 Fix implementation of range_t::empty
A range with an undefined end point would be reported as empty.
2016-08-25 09:41:21 +02:00
Allan Odgaard
b97a3fc3f8 More crash report info related to drag’n’drop issue 2016-08-25 09:41:21 +02:00
Allan Odgaard
b254d94192 Set a text color for find window status bar
After an OS upgrade (10.11?) clicking the status bar text (making it switch to the alternate text) would make it change color of the text.
2016-08-25 09:22:37 +02:00
Allan Odgaard
0b15e58844 If duplicating the active tab’s document then we open the duplicate 2016-08-25 00:07:47 +02:00
Allan Odgaard
0c08c608fe Let file browser post notification when duplicating URLs 2016-08-25 00:07:47 +02:00
Allan Odgaard
f9e02d9fdc Allow setting fontName and fontSize differently for each document
Previously we would read these values when creating the OakTextView so they would be used for all document types. Now they are re-read each time we change document, so it’s possible to have different fonts for different documents based on type or location.
2016-08-24 22:26:47 +02:00
Allan Odgaard
c488d25555 Add support for rendering strikethrough text 2016-08-24 21:22:26 +02:00
Allan Odgaard
2593550f9a Parse ‘strikethrough’ in fontStyle 2016-08-24 21:22:26 +02:00
Allan Odgaard
0663b21025 Use symbolic name for kCTUnderlineStyleSingle 2016-08-24 21:14:02 +02:00
Allan Odgaard
85a82d2bf8 Allow theme’s fontStyle to mix plain with bold, italic, and underline
If we set ‘plain bold’ then it means that italic and underline are explicitly disabled (should a more general theme rule enable them), but bold is left enabled.
2016-08-24 20:09:34 +02:00
Allan Odgaard
20f90b507b Add leading/trailing ellipsis for truncated search results 2016-08-24 19:51:56 +02:00
Allan Odgaard
5d4b9e3168 Ensure monospaced digits for search results line number prefix 2016-08-24 19:51:55 +02:00
Allan Odgaard
fce6ad2574 Make search results font configurable
The defaults keys are searchResultsFontName and searchResultsFontSize.
2016-08-24 19:51:55 +02:00
Allan Odgaard
232461fb47 Miniaturized windows would not show when clicking TextMate’s app icon
This was only if the user had disabled creating untitled documents on re-activation in Preferences.
2016-08-22 22:37:18 +02:00
Allan Odgaard
59ac63bd94 Simplify OakFileBrowser’s selectedPaths implementation 2016-08-22 16:14:36 +02:00
Allan Odgaard
9818980b8c Change where we redirect stdin/out in ‘relaunch target’ build script 2016-08-22 16:14:36 +02:00
Allan Odgaard
a8fa7383b5 Calling revealBundleItem: without an item is now a no-op 2016-08-22 16:14:36 +02:00
Allan Odgaard
fbc7bab291 With multiple unsaved documents use Save All as button title 2016-08-22 16:14:36 +02:00
Allan Odgaard
7645d1981e Ensure numbers are monospaced in tool tips
Some commands rely on this, for example the word count command (Statistics for Document).
2016-08-22 16:14:36 +02:00
Allan Odgaard
3b3d86a320 Use WebView’s stopLoading instead of killing the running task
This is a more appropriate API to use for signalling that we wish to abort the running command.
2016-08-21 12:24:40 +02:00
Allan Odgaard
89c19eff61 Change ‘runningCommand’ getter to ‘isRunningCommand’ 2016-08-21 12:23:40 +02:00
Allan Odgaard
aef22e4669 Always check for subfolders before creating submenu in folder pop-up
Searching a folder with no subfolders and opening the folder selection pop-up menu in the find dialog would previously show the folder with an arrow, indicating that it had subfolders.
2016-08-21 12:09:32 +02:00
Allan Odgaard
a5746e093c Increase find dialog’s Recent Places history to 20
It’s actually 20 plus the current item, hence why the source shows 21.
2016-08-21 12:09:32 +02:00
Allan Odgaard
8679b5b869 Redirect protocol-relative URLs in HTML output to https
The problem is that HTML output is loaded from the x-txmt-command protocol, possibly with the “base URL” set to file://$TM_FILEPATH, so protocol-relative URLs like //example.org/main.css would be resolved as file://example.org/main.css.

We now try to detect these URLs (heuristically, since we only see the resolved URL) and (by default) redirect to https.

This commit checks for the presence of NSURLComponents which was introduced in Mac OS X 10.9. On 10.8 this commit has no effect.
2016-08-21 12:09:32 +02:00