Commit Graph

5597 Commits

Author SHA1 Message Date
Allan Odgaard
6b6ff32e99 Avoid compiler warning by typecasting anonymous enum
The warning only appears when the anonymous enum is used in a conditional, hence why we do not need this change for all calls to NSFileTypeForHFSTypeCode.
2021-01-17 14:06:36 +01:00
Allan Odgaard
4606fdefff Create default bundles archive in ninja file and store in build dir
Previously we would download and archive the default bundles as part of ./configure and place the result in our source directory, this however both pollutes the source directory with generated files, but also had the ./configure step actually do a partial build, since we need to build the ‘bl’ executable to download bundles.
2021-01-16 19:14:22 +01:00
Michael Sheets
c90a9bb329 Prevent UTTypeConformsTo self-reference
Prevent public.shell-script from conforming to itself creating a loop, should conform to public.script.

Reported by Thomas Tempelmann.
2021-01-16 09:49:53 -06:00
Allan Odgaard
a7406b832d Use tertiary label color for shortcuts and tab triggers on macOS 10.16
For bundle items we have to decorate the menu items ourselves with shortcut keys and tab triggers, which were previously rendered with the system text color, but starting with Big Sur, it appears to use the tertiary label color, which we now match.
2021-01-15 16:03:03 +01:00
Allan Odgaard
4468362b40 Add leading/trailing padding for the save dialog’s encoding options
On Big Sur, using the compact view, these would extend to the left/right borders of the sheet.
2021-01-15 16:03:03 +01:00
Allan Odgaard
eb59a21ccd Do not set NSWindowStyleMaskFullSizeContentView for clipboard history
Setting this flag means the content view spans the full window size, thus is rendered “behind” the window chrome, which is how we have designed these windows, which hold a scroll view as the main content.

However, starting with macOS 10.16 (Big Sur) the scroll view doesn’t automatically set the top inset to adjust for the title bar (and auxiliary view), at least it has not yet been set, when we adjust the bottom inset, and disable further (automatic) changes of the scroll view insets.

By not setting the full size flag, the content view’s size is limited to the “visible are” of the window, but there seems to be some special detection of full size scroll views, so this one still gets the “full size” effect with content behind window chrome.
2021-01-15 16:03:03 +01:00
Allan Odgaard
c0a211582d Remove mercurial build dependency
This is only for running the SCM tests, which we currently omit.
2021-01-13 22:59:11 +01:00
Allan Odgaard
bc6623154a Remove stuff about libressl from README
We removed the libressl dependency in e06109a3b5.
2021-01-13 22:59:11 +01:00
Allan Odgaard
bcd44a8d14 Ensure we are running on the main thread when updating property
Since we bind the disabled state of the “Check Now” button (in preferences) to this property, we cannot update the property in a background thread, as the UI can only be updated from the main thread.
2021-01-13 22:59:11 +01:00
Allan Odgaard
8ed4b43b63 Remove “Add License” button from window chrome 2021-01-13 22:59:11 +01:00
Allan Odgaard
b24eea89a5 Introduce ${YEAR} variable in our InfoPlist.strings
This saves us from having to update the copyright each year.
2021-01-12 10:43:53 +01:00
Allan Odgaard
05ab01e857 Add build rule that expands variables in InfoPlist.vstrings files
The extension is converted to from ‘vstrings’ to ‘strings’ and it is saved as UTF-16. Ideally this would not introduce a new extension (and rely on the existing ‘strings’ filter to convert to UTF-16), but see previous commit for the technical limitation preventing this.

TARGET_NAME and YEAR are predefined variables.
2021-01-12 10:43:53 +01:00
Allan Odgaard
ae9bdf5d7b Rename process_plist as it makes no assumption about input format 2021-01-12 10:43:53 +01:00
Allan Odgaard
2c6a825a95 Fix usage summary for process_plist
Old text looks like copy/paste from somewhere else.
2021-01-12 10:43:53 +01:00
Allan Odgaard
4e922dde99 Disable transformations with unchanged paths for assets in build dir
This relates to the build system: Transformations that does not change file name are called filters, this could e.g. be converting UTF-8 to UTF-16 or converting a property list to binary representation (without changing extension).

This currently works when the filter is applied to a file in the source directory, as we write the result to the build directory, but if the input is already in the build directory, we would create a new output with the same path, which would result in a malformed build file (multiple targets generate the same file and/or cycles in the dependency graph).

As a workaround, we only allow filters to be applied to files in the source directory. But it would be nice to lift this limitation.
2021-01-12 10:43:53 +01:00
Allan Odgaard
418de67329 Update dialog plug-ins (class property dot notation) 2021-01-12 10:43:53 +01:00
Allan Odgaard
937b6e0401 Use single quotes when using ‘notarize_pass’ and ‘notarize_user’
These variables are passed as arguments to commands that go through a shell interpreter, therefore spaces would be a problem.

Previously we expected the variables themselves to include proper escaping (or quotes), but that is problematic if they are set in build.ninja, as we recreate this file via a rule that passes all variables as arguments, and this rule already uses single quotes for escaping, so it would cause a problem, if the variables contains single quotes.
2021-01-11 16:19:02 +01:00
Allan Odgaard
53897ce4d5 Improve “estimated time remaining” code for software update
Use int64_t instead of NSUInteger, check against NSURLSessionTransferSizeUnknown, and ensure that completedUnitCount is the last thing we set on the NSProgress object, so that there is no potential race condition with a progress object being completed, but still having a non-zero estimated time remaining value.
2021-01-11 12:09:02 +01:00
Allan Odgaard
f032db7aeb Set lineBreakMode for text fields in OakChooser windows
We already setup proper line break mode for the strings displayed (via paragraph attributes), but having good defaults makes sense, so subclasses can forego setting it.
2020-12-29 15:57:09 +01:00
Allan Odgaard
2c528c31f3 Do not use ‘new metadata only’ option with replaceItemAtURL:…
We want to preserve the existing file’s metadata, although we manually take steps to do so, but no reason to disable the system’s functionality for this.
2020-12-29 15:57:09 +01:00
Ronald Wampler
a52383a099 Set the frame size via NSTitlebarAccessoryViewController's view property
When linking against the macos 11.0 SDK, the view size fails to update.
2020-12-29 15:57:09 +01:00
Jordan Rose
ea09ac026b Add "Close Tabs to the Left" as alternate of "Close Tabs to the Right"
This is useful when working with one set of files in a project, then moving to another set without closing the original set first.

Alternate menu items are pretty subtle, but there are already a lot of ways to close tabs, and I didn't want to clutter the menu further.
2020-12-29 15:57:09 +01:00
Allan Odgaard
e06109a3b5 Remove dependency on libressl 2020-12-28 10:24:04 +01:00
Allan Odgaard
b5293ad1df Use Security framework to decode license keys (instead of libressl)
This avoids a third party dependency.
2020-12-28 10:08:40 +01:00
Allan Odgaard
e4e54440b5 Selections from regexp searches would be “anchored”
Normally a selection done via search or double-click will be unanchored, so that the first use of shift-left/right will always extend the selection, as opposed to a selection done with keyboard, where shift-left/right moves the ending of the selection.
2020-09-27 13:57:34 +02:00
Allan Odgaard
0f4a857fd7 Leave out kCTUnderlinePatternSolid because of warning mixing enums
The value of this constant is zero, so it is unnecessary to include.
2020-09-27 13:57:34 +02:00
Allan Odgaard
127f05f6cf Use os_log_error instead of custom debug output macro 2020-09-27 13:57:34 +02:00
Allan Odgaard
cb5d81deef Remove commented debug output lines 2020-09-27 13:57:34 +02:00
Allan Odgaard
0967e31696 Send ‘length’ to attributed string instead of via string property 2020-09-27 13:57:34 +02:00
Allan Odgaard
746b9aba08 Do not declare a few ‘auto’ loop variables as also being ‘const’
This produces a warning with latest Xcode, stating that it produces a copy, as the variable is already const. This does seem a little strange, so it could be a problem with the analyzer, but not marking these variables const shouldn’t affect anything.
2020-09-27 13:57:34 +02:00
Allan Odgaard
3cf526fe34 Do not make software update fixtures in ./configure file
These fixtures were removed in cfb523e713
2020-09-18 09:27:18 +02:00
Allan Odgaard
7baf2b1ba5 Improve how we add styles when syntax highlighting find/replace strings
We only set underline and strikethrough when those are enabled, and use applyFontTraits:range: instead of explicitly setting the font.

The latter should avoid breaking font substitution, although to be safe, we still call fixFontAttributeInRange:.
2020-09-18 09:27:18 +02:00
Allan Odgaard
a25d240ad6 NewApplication template: Change perform{FindPanel → TextFinder}Action: 2020-09-18 09:27:18 +02:00
Allan Odgaard
b3afd947cf Copying search results are again stored on clipboard as a single string
I have not found it advantageous to get multiple carets when pasting search results, on the contrary, if we have a significant number of results, the multiple carets may impact performance.

This reverts the change that was made in 82593c8824.
2020-09-18 09:27:18 +02:00
Allan Odgaard
4e4d8ff352 File browser’s field editor (rename) would stay after pressing return
This problem started after f1a1e1920f (handling key equivalents in performKeyEquivalent: instead of keyDown:).

It does however not appear that it is necessary to manually handle the return key to activate editing, therefore we have removed handling of this key.

Most likely it was required before view-based table views.
2020-06-12 21:34:40 +07:00
Allan Odgaard
a11625421a Add “Create Link to Items” file browser context menu action
This will create symbolic links to the files on the clipboard.

It is equivalent to holding down control (⌃) when dropping files on the file browser.
2020-06-09 16:48:37 +07:00
Allan Odgaard
621e275b52 Begin-of-line zero-width search results would not show any content
This would happen if searching for an anchor that would match at the beginning of a line, e.g. ‘\A’ or ‘^’, with zero actual characters matched.
2020-06-09 16:48:37 +07:00
Allan Odgaard
fbc78d3b37 Remove initialization of libcurl
We no longer use libcurl anywhere in TextMate, so this line is no longer necessary.
2020-06-09 16:48:37 +07:00
Allan Odgaard
0f219bae4b Set (visible) key equivalents for file browser context menu
Some of the items require the key equivalent to be set as “inactive” as menu item keys are “global” and thus need to be unique, and can be triggered even when the view containing the context menu is not active.
2020-06-09 16:48:37 +07:00
Allan Odgaard
6e35cb98e1 Only update file browser menu item titles when it is the explicit target
Previously “Paste Next” in the Edit → Paste submenu could have its title updated to “Move Item Here”, which would never be restored back to “Paste Next”, similarly for regular paste.

This commit also drops the wrappers for the cut:, copy:, paste:, and delete: methods, as these wrappers resulted in a bit of redundancy related to menu item validation.
2020-06-09 16:48:37 +07:00
Allan Odgaard
b0228b9aff Remove redundant target setting from file browser context menu
We set target for all items in the menu during post-processing.
2020-06-09 16:48:37 +07:00
Allan Odgaard
f97946244a Let file browser call copyAsPathname: when seeing ⌥⌘C
We cannot do this via a menu item because this key equivalent is already used for Ignore Case in the Edit → Find → Find Options menu.
2020-06-09 16:48:37 +07:00
Allan Odgaard
f1a1e1920f Handle file browser shortcuts in performKeyEquivalent:
This is called before the main menu acts on keys, and thus allows us to catch keys that are otherwise assigned to menu items.

We only do this when the file browser is first responder, so it should be acceptable to have a few menu keys change behavior in that case.
2020-06-09 16:48:37 +07:00
Allan Odgaard
75a08d141b Use os_log_error when assertions fail 2020-06-07 16:50:18 +07:00
Allan Odgaard
da04968f17 Change target file for OakDebug to not link as a bundle
This was from back when each framework was built independently.
2020-06-05 21:22:50 +07:00
Allan Odgaard
249f365e70 Remove majority of code from OakDebug framework 2020-06-05 21:22:50 +07:00
Allan Odgaard
b2ace31314 Remove comment about _GLIBCXX_DEBUG
Unsure if this has any meaning for libc++.
2020-06-05 21:22:50 +07:00
Allan Odgaard
e141a97d26 Remove include of <oak/debug/OakDebugLog.h> 2020-06-05 21:22:50 +07:00
Allan Odgaard
066acad708 Remove use of WATCH_LEAKS (C++) 2020-06-05 21:22:50 +07:00
Allan Odgaard
e80ef1d0b7 Remove use of OBJC_WATCH_LEAKS 2020-06-05 21:22:50 +07:00