Commit Graph

1929 Commits

Author SHA1 Message Date
Allan Odgaard
ffd034453a Extend command::runner_t API 2014-03-29 09:57:09 +07:00
Allan Odgaard
74d6cc47da Use htmlOutputView.runningCommand instead of command::runner_t
The latter is updated via a dispatch queue and thus might be delayed (to after end of current event loop cycle). This is relevant when WebView itself terminates the URL loading and calls the “WebView should close” delegate method.

Here the HTML output view property has been updated (via the WebView delegate method) but the command runner has not yet executed the completion code (which updates it’s “is running” state).
2014-03-28 19:31:15 +07:00
Allan Odgaard
5a8967e88e Implement delegate method for WebView load failures
This can happen if the WebView itself terminates the load, for example if window.close() is called from JavaScript.
2014-03-28 19:31:15 +07:00
Allan Odgaard
c9400e036d Use std::string for memory management 2014-03-28 19:31:15 +07:00
Allan Odgaard
935da75a43 Use new path::temp API to set initial content 2014-03-28 19:31:15 +07:00
Allan Odgaard
5881b86775 Support initial content when creating temporary files 2014-03-28 19:31:15 +07:00
Allan Odgaard
1fbf878a4d Refactor/simplify command runner 2014-03-28 19:31:15 +07:00
Allan Odgaard
5f69ef31c7 Don’t use NS prefix for custom functions 2014-03-28 19:31:14 +07:00
Allan Odgaard
619a2cfec7 Change a few instances of floorf/fabsf → floor/fabs 2014-03-28 19:31:14 +07:00
Allan Odgaard
6d6210e490 Use ‘assign’ instead of ‘weak’ when building for 10.7 2014-03-28 10:19:06 +07:00
Allan Odgaard
ccac862602 Remove process_t 2014-03-28 10:19:06 +07:00
Allan Odgaard
45b297a150 Use custom code instead of process_t 2014-03-28 10:19:06 +07:00
Allan Odgaard
1e2f10ed46 Use dispatch queue instead of a thread for reading command output 2014-03-28 10:19:06 +07:00
Allan Odgaard
9d218ea846 We use camelCase for parameter names 2014-03-28 10:19:06 +07:00
Allan Odgaard
63d431b5ed Simplify parsing of multiple choice keys (tmCommand) 2014-03-28 10:19:06 +07:00
Allan Odgaard
4313571fc9 Parse ‘autoRefresh’ key from tmCommand files
This can be set to ‘onDocumentChange’ to indicate that the command should be re-run when the document changes, though the code hasn’t yet been written to handle this.
2014-03-28 10:19:05 +07:00
Allan Odgaard
c758c9296f Remove unnecessary check in menu item validation
Since the HTML output window responds to toggleHTMLOutput: we would never be called when that window is key.
2014-03-28 10:19:05 +07:00
Allan Odgaard
080dd3da18 Add showWindow:/close methods for HTML output window controller
These must be used for proper management of the “retainedSelf” property.
2014-03-28 10:19:05 +07:00
Allan Odgaard
33178679c7 Scroll to caret failed if mouse button was pressed
We want to disable “make selection visible” when the user is drag-selecting, though the previous check was too broad and would disable it if user opened a document via double click (e.g. a find in folder result).
2014-03-27 07:53:55 +07:00
Allan Odgaard
a6654f56c9 Using cut/copy will always update the system pasteboard
Previously we only updated the system pasteboard if it was different, but some users copy rich text from one application, paste it in TextMate and then copy it (in TextMate) with the expectation that the rich styles are stripped.
2014-03-26 19:02:42 +07:00
Allan Odgaard
7e02902ab0 Remove retain cycle from pasteboard history window 2014-03-26 19:02:41 +07:00
Allan Odgaard
b9fafd1495 Use local undo manager for file browser
This ensures that ⌘Z / ⇧⌘Z are only targeting the file browser when it has focus.

Previously these keys would act on the file browser undo stack when a view without it’s own undo/redo stack had focus, e.g. HTML output view.
2014-03-26 15:30:36 +07:00
Allan Odgaard
764a8407e9 Use undo manager’s menu item titles in file browser action menu 2014-03-26 15:30:36 +07:00
Allan Odgaard
6535546c87 Use view’s undo manager rather than the window’s 2014-03-26 15:30:36 +07:00
Allan Odgaard
1a20f3a42d Set accessibility description when creating action buttons 2014-03-26 15:30:36 +07:00
Allan Odgaard
a004fe685d Only set raised background style for borderless action buttons 2014-03-26 15:30:35 +07:00
Allan Odgaard
9f9cb23609 Improve alignment of glob text field in find window
The combo box’s top border should now align with the pop-up buttons on the same line, though it’s not baseline aligned.
2014-03-26 15:30:35 +07:00
Allan Odgaard
9ae2630607 Delete unused code 2014-03-26 15:30:35 +07:00
Allan Odgaard
ec491a4e19 Exclude divider images from accessibility
Since it is the cell that is providing the accessibility attributes the simplest way I could think of to have it ignored was to remove NSImageView’s support for the NSAccessibilityChildrenAttribute.

I tried using accessibilitySetOverrideValue:forAttribute: but it did not work for me, so a subclass was required.
2014-03-26 15:30:35 +07:00
Allan Odgaard
2cc71e57f9 Limit clipboard history display string to ~1024 code points
This should fix performance issues (during scroll).
2014-03-26 15:30:35 +07:00
Ronald Wampler
f45cb07d52 Moved OakCreateActionPopUpButton method to OakUIConstructionFunctions.h
While code reuse is an added benefit, the main motivation was to fix the appearance of the action popup button in the Find window. The first (placeholder) item in the Find window's action button was assigned a nop action so that when the button was clicked and it's menu validated, the "action" image would always appear as disabled.
2014-03-25 16:51:40 -04:00
Allan Odgaard
247e866760 Going to symbol or bookmark will now center selection
Previously it would just make sure the selection was visible, so if the symbol was already visible, no scrolling/centering would take place.

For most actions we want to minimize scrolling since it makes it easier to keep track of the location in the document, but for the “Go to …” actions, we’re doing an absolute positioning rather than a relative jump, so it makes sense to always center.

For bookmarks, it’s only when choosing a specific bookmark from the Navigation menu that we center selection, not when using the next/previous bookmark actions.
2014-03-25 20:32:46 +07:00
Allan Odgaard
a052c81cfa Improve crash reporting for C++ exceptions from keyDown: 2014-03-25 20:32:46 +07:00
Allan Odgaard
003d32832e Suppress “unused variable” warning from code generated by ragel 2014-03-25 12:41:37 +07:00
Allan Odgaard
cefb8cb2db Simplify sub-word movement tests 2014-03-25 12:19:58 +07:00
Allan Odgaard
527668683c Include numbers as a group for sub-word movement 2014-03-25 12:19:58 +07:00
Allan Odgaard
73453e5152 Do not restore project state for projects with no documents
The state being restored here would be file browser state, which might confuse the user if they are opening a folder via “mate” and then get a file browser restored for that project folder that show another location than the actual folder they open.

The reason we ignore the state when loading, rather than not saving it in the first place, is that by saving the state we make the folder show up in File → Open Favorites…
2014-03-25 12:19:58 +07:00
Allan Odgaard
69504292e5 Better job of moving caret/preserving selection for “toggle case”
Previously we would set a mark, mutate the buffer, and then restore selection based on how the mark was moved.

When a mutation was changing the buffer to its existing value (e.g. toggling case of a space character) then the buffer would effectively ignore the mutation, and the mark would not be properly updated, meaning for “toggle case of character” the caret would not be moved forward.

Additionally we previously always moved to the end of a mutation, even if it was done on a user selection. We now only move to the end if the user didn’t select anything (but ran the mutation on an implicitly selected unit, like a word). The “toggle case of word” action is affected by this.
2014-03-25 12:19:58 +07:00
Allan Odgaard
15025edbcc Set “color” to true if range is untouched by ‘extend_if_empty’ 2014-03-25 12:19:57 +07:00
Allan Odgaard
62645601f5 Introduce range_t::color field for somewhat arbitrary use
Also do a better job of preserving the “unanchored” property of a range.
2014-03-25 12:19:57 +07:00
Allan Odgaard
90d1fd432d Non-local drags from TextMate now include NSDragOperationGeneric 2014-03-25 12:19:57 +07:00
Allan Odgaard
1a95579844 Rework OakFileIconImage
We no longer let the image representation point back to the image, since the image might be copied.
2014-03-23 22:47:16 +07:00
Allan Odgaard
78cb28db9e Fix infinite loop in folder search for multi-byte encoded files
This would happen if a multi-byte encoded file ended with a partial code point, as we would continue to try and read more data to finish decoding.
2014-03-23 22:47:16 +07:00
Allan Odgaard
291dae476a Fix format string expansion for new bundles/bundle items
Iteration was unintentionally changed (in c2397484b8) to iterate over const references, which would prevent the referenced types to be updated.

The reason the compiler did not complain about it is due to the catch-all template function, indirectly changing visitation from non-const to const, and providing no-op visitation functions for the const types.

For this reason, I have replaced the template (member) function with functions for all types.
2014-03-23 22:47:16 +07:00
Allan Odgaard
d4faf3bef8 Code indicated we were preserving selection for kChangeCaseOfWord 2014-03-23 22:47:16 +07:00
Allan Odgaard
54d7f4bbeb Split regexp used for sub-word movement into multiple lines 2014-03-23 22:47:15 +07:00
Allan Odgaard
9397335400 Add tests for sub-word movement 2014-03-23 22:47:15 +07:00
Allan Odgaard
d7660bd89e Detect first loop iteration using std::exchange “idiom” 2014-03-23 22:47:15 +07:00
Allan Odgaard
af0e6cc643 Change decltype(mapVariable)::value_type → auto (C++14) 2014-03-16 18:06:03 +07:00
Allan Odgaard
f3f4efd062 Use binary literals in code (C++14) 2014-03-16 18:06:03 +07:00