Commit Graph

1591 Commits

Author SHA1 Message Date
Allan Odgaard
cbe937d3f3 Convert CFURL → std::string in plist::convert
This is mainly for debugging purposes (printing a CFDictionary).
v2.0-alpha.9421
2013-05-13 18:10:47 +07:00
Allan Odgaard
66b8ab54f9 Rewrite proxy code
We now use CFNetworkCopyProxiesForURL() to get the list of potential proxies, hopefully this will perform the proper “proxy auto discovery” (issue #973) though we still need to handle PAC ourself.

Presently we only use the first proxy found, ideally we would try them all (but this will require some API changes).
2013-05-13 18:08:35 +07:00
Allan Odgaard
f5c63828ee Remove path attributes from document_t 2013-05-12 23:04:57 +07:00
Allan Odgaard
61b8c844a5 fixup! Handle “did-save” bundle item callback in OakTextView 2013-05-12 22:48:46 +07:00
Allan Odgaard
91901bfdd3 Call bundleItemPreExec:… from command execution
This is instead of having a copy of the same code. Ideally command execution would be called after potential pre-exec stuff, but macro execution is presently handled by editor_t which doesn’t have access to the higher level stuff.
2013-05-12 11:09:18 +07:00
Allan Odgaard
e5cca3de18 Remove ‘document_settings’ API 2013-05-12 11:09:18 +07:00
Allan Odgaard
35ffdd5dd8 Don’t setup basic environment in ‘variables_for_path’
We expect the caller to pass us a properly setup environment.
2013-05-12 11:09:18 +07:00
Allan Odgaard
bf7d657eef Move some TM variables to oak::basic_environment 2013-05-12 11:09:18 +07:00
Allan Odgaard
ec9208afa9 Use whitelist feature to preserve dialog variables 2013-05-12 11:09:18 +07:00
Allan Odgaard
ce4ae62547 Change ‘variables_for_path’ API
We now accept the a directory in addition to the path. If a directory is provided, the path is only used to filter variables rooted at the directory.
2013-05-12 11:09:18 +07:00
Allan Odgaard
77a6dcebfe Remove unused typedef 2013-05-12 11:09:17 +07:00
Allan Odgaard
8b3f05485d Change argument ordering for ‘scope_variables’
Generally we should always provide a base environment, since the scoped variables are format strings. The filtering scope selector is however optional, and we do not have one when executing commands outside an fi;e/editor context.
2013-05-12 11:09:17 +07:00
Allan Odgaard
5eaa0a9d94 Remove “PWD API” for setting command working directory
Only the file browser and the ‘path_variables’ function (used for filters) made use of this method to set the working directory. Previously drop commands also used it, which is probably the only time we really need to set a working directory, as we provide the command with a relative file path.
2013-05-12 11:09:17 +07:00
Allan Odgaard
10e3536a80 Change method signature
We return a variables map instead of updating a map passed in by reference. The previous API was mainly done because we couldn’t previously return non-POD from Objective-C methods. Returning a map with variables makes the API more exact, e.g. how to handle existing entries is no longer an issue (that is, the caller will have to chose the appropriate duplicate strategy).
2013-05-12 11:09:17 +07:00
Allan Odgaard
4a32881c11 Remove legacy variable functions 2013-05-12 11:09:17 +07:00
Allan Odgaard
d669c9733b Do not setup variables in document::run 2013-05-12 11:09:17 +07:00
Allan Odgaard
02f688a525 Explicit variable setup for app controller commands 2013-05-12 11:09:17 +07:00
Allan Odgaard
985a3c1d92 Explicit variable setup for file browser commands 2013-05-12 11:09:17 +07:00
Allan Odgaard
1d1ce8e234 Explicit variable setup for completion commands 2013-05-12 11:09:16 +07:00
Allan Odgaard
12491e22f8 Let OakTextView set TM_CURRENT_THEME_PATH
Previously we relied on the delegate to set this, but a text view may not have a delegate. One could however argue that this is a “global” setting so should be set even when there is no text view.
2013-05-12 11:09:16 +07:00
Allan Odgaard
9b4734bf98 Explicitly collect variables from different components 2013-05-12 11:09:16 +07:00
Allan Odgaard
f02a68893d Don’t pass base environment to bundle_variables 2013-05-12 11:09:16 +07:00
Allan Odgaard
58cfa20a1b Add operator<< for std::map
This is to allow chaining inserts and to avoid temporary variables when inserting maps returned from functions.
2013-05-12 11:09:16 +07:00
Allan Odgaard
92192341d4 Let OakTextView pass an environment to document::run()
We no longer pass the bundle item by const-reference because it is now used (delayed) in a block and const-references are not captured by blocks (i.e. the lifespan is not extended).
2013-05-12 11:09:16 +07:00
Allan Odgaard
a6cf964e9f Remove callback support from document::run 2013-05-12 11:09:16 +07:00
Allan Odgaard
421a46d116 Rework setup/execution of drop commands
We now collect all variables (and working directory) prior to calling document::run() to remove the need for a callback.
2013-05-12 11:09:16 +07:00
Allan Odgaard
964b56898f Consult text view delegate when setting up variables
The delegate provides file browser variables.
2013-05-12 11:09:16 +07:00
Allan Odgaard
ccf2414768 Add pwd argument to command runner
Previously this was only possible to change by setting PWD in the passed-in environment.
2013-05-12 11:09:15 +07:00
Allan Odgaard
b66e58c4f8 Disambiguate function name 2013-05-12 11:09:15 +07:00
Allan Odgaard
7f4649ba32 Factor out deprecated variable collecting 2013-05-12 11:09:15 +07:00
Allan Odgaard
428739352c Obtain variables and scope context via ‘self’
This is instead of direct instance variable access.
2013-05-12 11:09:15 +07:00
Allan Odgaard
88ae04572c Handle “did-save” bundle item callback in OakTextView
While it’s easier to execute bundle items from a text view, it doesn’t work when saving documents that are not in the current text view.

This is an intermediate refactoring step — handling should (likely) end up in the DocumentSaveHelper class, but we need to improve dealing with command execution first, and by having the callback piggyback on the normal performBundleItem: method, we (temporarily) limit the code which use the command execution API, making refactoring easier.
2013-05-09 15:16:33 +07:00
Allan Odgaard
0fd03842b7 Move bundle requirement checking to bundles framework
This also generalizes it to being applicable to all bundle items (not just commands).
2013-05-09 15:16:33 +07:00
Allan Odgaard
4c24bd9c00 Avoid ref to static data when returning non-POD from Objective-C
Apparently clang (now?) support transferring non-POD types from and to Objective-C++ methods, eliminating the need for doing this by passing a (const) reference.
2013-05-09 15:16:33 +07:00
Allan Odgaard
5fd188531a Change naming of functions for obtaining variables
These are now all prefixed with what they are obtaining variables for (scope, document, bundle, …) which makes it easier to analyze/refactor the code.

Also change document_t’s settings function to document_settings.
2013-05-09 15:16:32 +07:00
Allan Odgaard
e49504a644 Remove unused member data 2013-05-06 14:51:32 +07:00
Allan Odgaard
135c6c79b7 Remove redundant instance variable 2013-05-06 14:51:31 +07:00
Allan Odgaard
b489687403 Disable AuthorizationExecuteWithPrivileges deprecation warning
The “proper” replacement for this API is to use the ServiceManagement framework’s SMJobBless() to bless our helper tool. In two of the three use-cases our helper tool is however regular shell commands, so it seems redundant to wrap these shell tools as helper tools we can install as launchd jobs.
2013-05-06 14:51:31 +07:00
Allan Odgaard
4188c486fb Ensure height of find/replace fields are >= 22 points
Fixes #972.
2013-05-06 14:51:31 +07:00
Allan Odgaard
7796e18e59 Limit exposed stuff in OTV headers 2013-05-03 14:41:52 +07:00
Allan Odgaard
f68a1cd280 Fix non-working link arrows in bundle item chooser
Since we released sender (via aliased pointer) before querying it, we would fail to obtain the item clicked.
2013-05-02 16:38:56 +07:00
Allan Odgaard
6e4b305587 fixup! Cleanup a failed GitHub upload 2013-05-02 16:13:33 +07:00
Allan Odgaard
799ebd12e4 Checkin release notes v2.0-alpha.9419 2013-05-02 15:11:03 +07:00
Allan Odgaard
5f1cdb947a Clicking link arrows should not select rows 2013-05-02 15:07:10 +07:00
Allan Odgaard
ded37a128c Add link arrows to Preferences → Bundles
This takes the user to the bundle’s home (generally a GitHub page) which should make it easier to clone the source repository or report issues via the bundle’s issue tracker.
2013-05-02 15:07:10 +07:00
Allan Odgaard
13af5d8604 Make click-sorting non-content columns a no-op 2013-05-02 15:07:10 +07:00
Joachim Mårtensson
35227b48ea Injected rules rank higher if they match against the left scope
This allows overriding “native” rules via injecting.

This commit drops support for using ‘.’ as (injection) scope selector to match everywhere. Instead use ‘*’.
2013-05-02 15:07:10 +07:00
Allan Odgaard
715624b952 Handle failure to create folding dots image
Based on crash reports this appears to happen for some users, though only reason I can imagine is if the images are not found in the application bundle (which would happen if the application is moved after launch, but that normally cause many things to fail).
2013-04-28 11:46:35 +07:00
Allan Odgaard
acaff3e352 Add expiration date to TextMate
The user will get daily reminders when the application is more than a month old, and it will stop working when it’s two months old.

Normally not a fan of expiring software but a significant amount of the requests sent to api.textmate.org (posting crash reports, updating bundles) are from versions more than a month old. Adding to that, the expiration date serves as a fallback for potentially broken software update checking.
2013-04-28 11:46:35 +07:00
Allan Odgaard
e1ff0ceaff Move already open find/HTML windows to active space
This is only when invoking the “order front” action and the window is already showing on another space.
2013-04-28 11:46:35 +07:00