Commit Graph

4097 Commits

Author SHA1 Message Date
Allan Odgaard
565c5c242b Let file name formatter return error string for unexpected value type
One spin report shows that an attributed string is being used with the text field. Calling ‘description’ on an attributed string can produce a lot of output (dumping all the attributes) and the spin report in question shows a lot of symbols related to auto-layout and text sizing, so perhaps this is related.

http://lists.macromates.com/textmate/2016-August/039891.html
v2.0-beta.12.7
2016-08-30 11:56:47 +02:00
Allan Odgaard
b84ebc197a Checkin release notes for 2.0-beta.12.6 v2.0-beta.12.6 2016-08-30 09:37:16 +02:00
Allan Odgaard
6bc27b8511 Handle begin/end undo grouping for document w/o document editor
Previously this would be a no-op basically bringing the undo stack out of sync and making TextMate prone to crashing.

We create an undo group when reloading document changes and here we do not create a document editor, hence when this happened for unselected tabs (which currently have no document editor), the undo stack was brought out of sync.
2016-08-30 09:15:17 +02:00
Allan Odgaard
0e70b95dbb Commands run from bundle editor lacked variables from the OakTextView 2016-08-29 21:41:34 +02:00
Allan Odgaard
386979ed2d Enable “backup on change” for documents
This was disabled (by accident) during the migration to OakDocument, although we would still backup document content when project properties were changed (like active tab or window size).

The reason we require DocumentController to explicitly enable backups is that we do not want backups for bundle editor and commit window, since these (currently) are unable to restore documents, and the former is never really closed, so the backups would live forever.
2016-08-29 21:24:34 +02:00
Allan Odgaard
b0c77ff656 Fix minor whitespace issues 2016-08-29 12:44:15 +02:00
Allan Odgaard
caa72fca85 Remove FSItem’s setNewDisplayName: 2016-08-29 12:34:26 +02:00
Allan Odgaard
cb6a5a911f Edit last path component instead of display name in file browser
This commit turned out rather complex because the only proper way to do this seems to do with a data formatter, but the data formatting protocol assumes that we can construct an object from the editing string, which is not possible when the string only represents a subset of the object being edited.
2016-08-29 12:31:38 +02:00
Allan Odgaard
50d2815645 Add renameToName: to FSItem
Unlike the existing setNewDisplayName: this function does not try to figure out if the argument was the file’s display name (with potentially hidden extension).
2016-08-29 11:16:18 +02:00
Allan Odgaard
0c4642302a Remove reference to textmate-dev mailing list 2016-08-29 11:12:00 +02:00
Allan Odgaard
fe991f7b4b Improve error message for failure during save 2016-08-29 07:51:45 +02:00
Allan Odgaard
ce21cb8ea4 Make swap_and_unlink a private function 2016-08-29 07:50:43 +02:00
Allan Odgaard
f76e6072e3 Use path::rename_or_copy for saving property lists 2016-08-29 07:50:43 +02:00
Allan Odgaard
2b3f0734d5 Use path::rename_or_copy for backups 2016-08-29 07:50:19 +02:00
Allan Odgaard
0d7390cdc3 Use path::rename_or_copy for TextMate’s own data files 2016-08-29 07:48:37 +02:00
Allan Odgaard
f92a783a96 Introduce path::rename_or_copy
Unlike path::swap_and_unlink we do not try to use exchangedata() since support for this is missing from the upcoming AppleFileSystem, so it would seem to be somewhat deprecated.
2016-08-29 07:48:37 +02:00
Allan Odgaard
4ab38d3cfd Use the S_IRWX[UGO] constants to set file mode 2016-08-28 17:49:17 +02:00
Allan Odgaard
46fb745bbe Use perrorf when printing errors with dynamic strings
Also revise error messages to be more consistent.
2016-08-28 17:25:26 +02:00
Allan Odgaard
fe301508c8 Introduce perrorf as shorthand for fprintf with strerror 2016-08-28 17:25:19 +02:00
Allan Odgaard
4c8308b520 Use perror instead of fprintf + strerror 2016-08-28 17:24:14 +02:00
Allan Odgaard
c0d6967480 Let OakTextView store an OakDocument instance instead of document_t 2016-08-28 17:23:05 +02:00
Allan Odgaard
9d48b5683b Don’t let OakTextView use any of the document_t wrapper methods 2016-08-28 17:22:06 +02:00
Allan Odgaard
c78473dc6c Make OakDocument’s visibleIndex and selection properties public 2016-08-28 17:21:35 +02:00
Allan Odgaard
c942dde920 Only use OakDocument in document_view_t
Also change indent property to tab_size and soft_tabs.
2016-08-28 17:20:08 +02:00
Allan Odgaard
9c4589d541 Inform callbacks about updated scopes when interrupting “batch parsing”
We delay updating callbacks until we have parsed 10 lines to avoid line-by-line redraw of the screen, but incase the buffer got mutated during this batch parsing, we would previously restart the parser and forget about the ranges already parsed (that no-one had been told about).
2016-08-28 17:03:58 +02:00
Allan Odgaard
7029992159 Only suppress “did parse” callback when next dirty line is our next line
Incase something earlier in the document became dirty, while in batch update mode, we would keep using the old value of ‘batch_start’ when eventually calling ‘did_update_scopes’.

Under normal circumstances though making the buffer dirty would bump the revision, which drops the batch info, but if e.g. we change grammar, we mark the document dirty without bumping the revision.
2016-08-28 17:03:58 +02:00
Allan Odgaard
8dd33c654c Pass function parameter by value instead of const-reference 2016-08-28 17:03:58 +02:00
Allan Odgaard
5df4da9eb3 Removed unused function parameter 2016-08-28 17:03:58 +02:00
Allan Odgaard
6959ca68f3 Dismiss “Stop Command?” HTML output dialog if command exits by itself 2016-08-28 13:40:56 +02:00
Allan Odgaard
ba8dfaf9fd Remove some unused document::run delegate methods 2016-08-28 13:32:49 +02:00
Allan Odgaard
c7d3aa3649 Move show_command_error to DocumentController 2016-08-28 13:32:49 +02:00
Allan Odgaard
14782c0aea Remove old custom URL protocol 2016-08-28 13:32:49 +02:00
Allan Odgaard
e282dc2fd2 Remove commandRunner from HTMLOutputWindow and DocumentController 2016-08-28 13:32:49 +02:00
Allan Odgaard
0153e837a8 Remove document::run API 2016-08-28 13:32:49 +02:00
Allan Odgaard
15d4f6c122 Use executeBundleCommand:variables: in editor_t’s command runner 2016-08-28 13:32:49 +02:00
Allan Odgaard
350db382d9 Use executeBundleCommand:variables: in performBundleItem: 2016-08-28 13:32:49 +02:00
Allan Odgaard
5783cceac7 Use executeBundleCommand:variables: in dropFiles: 2016-08-28 13:32:49 +02:00
Allan Odgaard
991822635f Use executeBundleCommand:variables: in filterDocumentThroughCommand: 2016-08-28 13:32:49 +02:00
Allan Odgaard
24a133d5a5 Add executeBundleCommand:variables: to OakTextView (internal API) 2016-08-28 13:32:48 +02:00
Allan Odgaard
f01bf97630 Add OakCommand responder methods to OakTextView and DocumentController 2016-08-28 13:32:48 +02:00
Allan Odgaard
d142f82f9f Check ‘isRunningCommand’ instead of ‘runner->running()’ 2016-08-28 13:32:48 +02:00
Allan Odgaard
29033c60d8 Use OakCommand in file browser and application delegate 2016-08-28 13:32:48 +02:00
Allan Odgaard
1da89cc5a0 Check for ‘x-txmt’ prefix in URL scheme instead of exact match 2016-08-28 13:32:48 +02:00
Allan Odgaard
f3745fe034 Add new OakCommand framework
A lot of the code is copy/pasted from the document::run implementation, our command::runner and HTMLOutput (custom URL protocol).
2016-08-28 13:32:48 +02:00
Allan Odgaard
974db67258 Read isRunningCommand property instead of looking at URL scheme 2016-08-28 13:32:48 +02:00
Allan Odgaard
bb038b0670 Remove unused HTMLOutputWindow properties 2016-08-28 13:32:48 +02:00
Allan Odgaard
bd61830833 Rework how we find suitable OakHTMLOutputView for command execution 2016-08-28 13:32:48 +02:00
Allan Odgaard
894b33d0bf Set frame autosave name of HTML output windows during creation 2016-08-28 13:32:48 +02:00
Allan Odgaard
fce09a3edf Add mainFrameTitle property to OakHTMLOutputView 2016-08-28 13:32:48 +02:00
Allan Odgaard
b598252c58 Add commandIdentifier property to OakHTMLOutputView 2016-08-28 13:32:48 +02:00