Commit Graph

217 Commits

Author SHA1 Message Date
Allan Odgaard
bcc3e4c1fb Fix refresh/undo for commands causing document saving
Since saving is asynchronous the scoped refresh/undo helper would do “cleanup” before the command ran and potentially made document changes.

Commands executed at a lower level (i.e. by editor_t via macros) presently still has this issue. This should be fixed when macros are refactored (this isn’t the only issue related to macros).

Closes #450.
2013-04-25 16:38:33 +07:00
Allan Odgaard
29aa65d5d9 Use blocks for document save callback 2013-04-25 15:33:32 +07:00
Allan Odgaard
9083ca8206 Close bundle install sheet on error
Previously incase of error the sheet would keep showing effectively locking up the document window.

This is related to issue #85 although the reason why installing bundles fails for some users is still unanswered.
2013-04-23 18:57:25 +07:00
Allan Odgaard
cdb75619ca Add completion callback to installBundle: 2013-04-23 18:52:08 +07:00
Dirk Geurs
a2128f11cd Setup document scope attr.project.lein for Leiningen projects
Leiningen is a build automation and dependency management tool mainly used for Clojure projects.

https://github.com/technomancy/leiningen
2013-04-03 23:07:30 +07:00
Allan Odgaard
0bf02dbeff Move divider line functions to OakUIConstructionFunctions.h 2013-04-02 04:11:32 +07:00
Allan Odgaard
9b94a279ac Setup document scopes for initial untitled document 2013-04-01 13:22:41 +07:00
Allan Odgaard
ea206ed269 Setup attr.os-version as part of document scopes
While not exactly a document scope, the advantage is that document scopes are always set, where project scopes are only setup for “projects”.
2013-04-01 13:22:41 +07:00
Allan Odgaard
ac23c9538e Bind to updated BundlesManager binding properties 2013-03-25 20:31:48 +01:00
Allan Odgaard
787ae1cba8 Only “force” selection search when document window is key
Since the find dialog itself will call orderFrontFindPanel: when selecting the first item in the “in” pop-up (this is required to have it show ⌘F as key equivalent) we need to avoid changing search scope to “selection” for this case.
2013-03-22 12:39:44 +01:00
Jacob Bandes-Storch
37e98655ec Implement filter through command
Closes #131
2013-03-21 22:12:08 +01:00
Allan Odgaard
d021d97b43 WIP: Filter through command 2013-03-21 14:39:48 +01:00
Allan Odgaard
d68e6a0499 Dragging last tab from window w/o file browser will close window
Closes #904.
2013-03-19 14:56:23 +01:00
Allan Odgaard
398e55cdbe Add helper functions to get OS version
We need this in a few places and while calling Gestalt() isn’t that much code, that function is deprecated in 10.8 and the alternative is a lot more code, so we don’t want to repeat that once we update the code.
2013-03-17 15:44:06 +01:00
Allan Odgaard
b0a0df831a Add ability to set project folder via file browser
For now it is done via a new menu item in the top folder pop-up. It might be useful to also show this menu item in the general action menu.
2013-03-16 17:49:49 +01:00
Allan Odgaard
b5eb83d383 Refactor code 2013-03-13 12:38:12 +01:00
Allan Odgaard
db5df4a58c Update Find window API 2013-03-13 12:37:22 +01:00
Allan Odgaard
cceff2cb99 Clear previous frame when switching side of file browser 2013-03-11 17:28:34 +01:00
Allan Odgaard
514f65bcb5 Improve window sizing when toggling file browser
The first time the browser is toggled, we’ll save the current frame so that we can restore it if the user toggles again (the calculated frame won’t match when window is moved or width is “truncated”).

Additionally when file browser is on the left side, we reframe the window so that the text view remains in the same place on the screen.

Closes #827.
2013-03-11 17:24:41 +01:00
Allan Odgaard
4a24d0ad58 Rework find dialog (part one)
This is work in progress but I don’t think any functionality is missing compared to previous commit, although some functionality might be less polished, e.g. the action buttons don’t properly enable/disable and the height of the results list gets lost when hiding it.

Some of the stuff that has changed / improved:

 * The find/replace text fields adjust their height to encompass the content (closes #94). Presently though the initial height of the ontrols is one line regardless of content (but they should adjust on first edit).
 * You can use Save All (⌥⌘S) to save affected files after Replace All (closes #558).
 * The key equivalents / actions available in the Find dialog is now easier to find via the action pop-up, which also has enables accessibility.
 * Using Next (⌘G) or Previous (⇧⌘G) with search results will move selection up/down.
 * Using Find All with ‘in’ set to ‘Selection’ will find and select all matches in the current document, which fixes #425, though it might be more desirable to show the results in the find dialog (like Find All does for a document or folder).
2013-03-07 10:50:19 +01:00
Allan Odgaard
ae15687db4 Move focus to document when closing split with focus
This applies to file browser and HTML output (when configured to be shown in the document window).

Closes #838.
2013-03-04 10:43:58 +01:00
Allan Odgaard
2c6504b82f Use symbolic constants for binding properties 2013-03-03 15:53:05 +01:00
Allan Odgaard
e8efb3638d Fix Go → Current Document with no project folder
We were creating an NSURL from the project folder which would throw an exception when the project folder was nil.
2013-03-01 22:03:58 +01:00
Allan Odgaard
5e6cfe8e1e The 10th tab now get ⌘0 as key equivalent 2013-02-27 21:05:09 +01:00
Allan Odgaard
c4323efbb7 Use path::is_child instead of custom code 2013-02-25 15:25:17 +01:00
Allan Odgaard
ca0c72e0c0 Fix potential retain loop via document SCM callback
If we closed a window with a document SCM callback for the current document, but that document was untitled (so it wouldn’t be cleared during shutdown), we would keep ‘self’ retained.
2013-02-22 17:59:42 +01:00
Allan Odgaard
e974f165a2 Add newFolder: forwarding to document controller 2013-02-21 22:08:52 +01:00
Allan Odgaard
1f0a558adc Add performCloseAllTabs: action method
Closes #808.
2013-02-21 21:58:32 +01:00
Allan Odgaard
cbb0a7864d Drop ‘ng’ namespace for scm 2013-02-21 17:39:55 +01:00
Allan Odgaard
0d8ccd17f0 Exclude file browser width from new windows’ width
Closes #679.
2013-02-19 22:08:13 +01:00
Allan Odgaard
0bf5a85a1c Resize window when toggling file browser
If you dislike this it can be disabled using:

    defaults write com.macromates.TextMate.preview disableFileBrowserWindowResize -bool YES
2013-02-19 21:13:53 +01:00
Allan Odgaard
6c48d1d9d7 Always set variable for commands with requirements
Previously we would only set the variable if the command couldn’t be found via PATH. By always setting the variable, we remove redundancy from commands, as they can now rely on the variable instead of needing fallback code (to load via PATH).

The downside is that there are cases where a command may wish to know if the user explicitly set the variable, for example the Run command for Python will ignore the script’s shebang if the user explicitly set TM_PYTHON. As this command doesn’t use the requirement system, it’s not an actual problem. Should it want to specify the requirement, it can do so by using a variable like TM_PYTHON_AUTO and then in the locations array, set TM_PYTHON, this would allow the command to test if TM_PYTHON is set and if not, still have ‘python’ available via the TM_PYTHON_AUTO variable — although, should python not be found, the error dialog will tell the user to set TM_PYTHON_AUTO.

Issue #767
2013-02-18 21:55:59 +01:00
Allan Odgaard
274a658f6f Make encoding “hex view” wider
Since switching to Menlo the lines were being wrapped.
2013-02-18 15:38:26 +01:00
Allan Odgaard
72e54020e6 Add menu validation for Select Next / Previous Tab 2013-02-18 15:38:25 +01:00
Allan Odgaard
f3bf828b15 Edit → Select → None would crash with no file browser 2013-02-16 10:43:55 +01:00
Allan Odgaard
c031557df2 Add ‘New Document’ to file browser
This create a new file on disk and brings up the “rename” text field.

You can control the type/extension either in Preferences → New document type or by setting it in .tm_properties, e.g.:

    [ attr.untitled ]
    fileType = 'source.objc++'

New Document can be undone, but it is handled by deleting the file on disk and losing potential edits you have made since creating it.

Closes #161.
2013-02-15 15:27:57 +01:00
Allan Odgaard
fbf76bbd79 Update file browser when a document changes path
This is required incase the file is open, as we then want the new path to show the close button.
2013-02-15 15:27:56 +01:00
Allan Odgaard
4c96cb5258 Reject custom project directory if not an absolute path 2013-02-15 15:27:56 +01:00
Allan Odgaard
9f095a52bc Close files deleted via file browser
Files with changes are kept open and only files deleted via file browser actually close. It’ll make sense to also close files which are “moved to trash” (but want to do some refactoring before adding that).

Closes #512.
2013-02-15 15:27:55 +01:00
Michael Sheets
2bd089ffe5 Match HTML divider color with the status bar divider 2013-02-12 21:55:56 +01:00
Allan Odgaard
2588d57421 Change where we invalidate cursor rects
Maybe closes #783.
2013-02-12 11:09:24 +01:00
Allan Odgaard
26fe4a95e9 Add Edit → Select → None (⇧⌘A)
This can be used to deselect all in the file browser.

Closes #779.
2013-02-11 22:05:44 +01:00
Allan Odgaard
059a8a0b75 Improve Quick Look menu item title
This now also shows what it’ll display and switches to “Close Quick Look” when the panel is already showing.
2013-02-11 14:21:23 +01:00
Allan Odgaard
2acecd66f3 Show icon in Go to Tab sub menu 2013-02-11 14:21:21 +01:00
Allan Odgaard
9c42d1ae9f Moving focus to file browser now select first item
This is only when using the special Navigate → Move Focus to File Browser (⌥⌘⇥) command and is mainly because there is no other visual feedback (other than the text view being rendered in its inactive state).

I could see sometimes not wanting a selection in the file browser, this however seems like a general problem (i.e. the solution should likely be to introduce a way to “deselect all”).
2013-02-08 13:55:09 +01:00
Allan Odgaard
9eb4044fdb Switch to simpler regexp::search 2013-02-08 11:20:35 +01:00
Allan Odgaard
001888c1cb Close Other no longer closes untitled but modified tabs
We would previously bring up an “Do you want to keep unsaved changes?” sheet for these, so no convenience (i.e. batch closing several modified tabs) is really lost (on the contrary).
2013-02-08 11:20:34 +01:00
Allan Odgaard
cafb518be8 fixup! Fix infinite loop for documents outside project folder 2013-02-06 18:24:50 +01:00
Allan Odgaard
fbb2f972f9 Don’t mark parent views as opaque
The reason for this is that NSTextField will draw itself in the “faded” state (for non-key windows) unless some of its parent views are marked opaque.

The previous problem with not having the parent views opaque (see da3a91a7bb) seems to have been solved by setting the autohidesScrollers property to YES.
2013-02-06 14:50:04 +01:00
Allan Odgaard
642b009ec9 Add to existing content view instead of replacing it
The window border drawing seems to be done by the root content view so it’s best to keep it around (as it may also do other things that we are unaware of).
2013-02-06 14:50:04 +01:00