143 Commits

Author SHA1 Message Date
Allan Odgaard
371d426c5f Add ‘char const*’ insertion API to ng::buffer_t 2016-06-21 23:23:44 +02:00
Allan Odgaard
735ba3a386 Remove explicit BOM support from document_t 2016-06-21 19:20:56 +02:00
Allan Odgaard
5c7b04fbd3 Add missing include for test/jail.h 2016-06-19 08:45:16 +02:00
Allan Odgaard
41ed2817e7 Remove unused ‘searchBackups’ argument from document::find
The function will always search backups and so far there has not been a reason to disable it.
2016-06-16 10:53:11 +02:00
Allan Odgaard
221026472d Change document_t source to Objective-C++ 2016-06-14 20:42:26 +02:00
Allan Odgaard
781eb82c43 Remove unused support for non-recursive document callbacks 2016-06-14 20:42:26 +02:00
Allan Odgaard
0e52185c00 Remove const versions of document_t’s buffer and undo_manager
Also remove the document_const_ptr typedef.
2016-06-14 20:42:26 +02:00
Allan Odgaard
67e4378a1e Don’t cache last-recently-used date in document_t
This optimization is hardly worth the added code complexity.
2016-06-13 13:02:50 +02:00
Allan Odgaard
cc03dd908e Remove document_t’s old reader API 2016-06-13 13:02:50 +02:00
Allan Odgaard
e0daad4ca3 Add visitor interface to document_t
This exposes less types and thus it is easier to change the implementation.
2016-06-13 13:02:50 +02:00
Allan Odgaard
9d308e4aa0 Use file::reader_t directly (instead of file_reader_t wrapper) 2016-06-13 13:02:50 +02:00
Allan Odgaard
dfd4c1cd6f Remove unused reader subclasses 2016-06-13 13:02:49 +02:00
Allan Odgaard
36fedf5bee Change most buffer helper functions to accept buffer_api_t 2016-06-13 13:01:10 +02:00
Allan Odgaard
414c336ba9 Remove descendants when mark to remove has a trailing slash 2016-06-02 21:07:43 +02:00
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Adam Strzelecki
e59db8375f Use panel language unless spellingLanguage is specified
This partially reverts changes of 3fdc72b93a:
Support spell checking being “automatic by language”.

Before 3fdc72b spellingLanguage .tm_properties setting (default "en") was the
only way to set spelling language for file (buffer). English was default
language for all files. 3fdc72b introduced change that when “automatic by
language” was selected in system's spelling panel then TextMate was ignoring
spellingLanguage setting and was using automatic by language.

However because “automatic by language” is default on OS X, effectively 3fdc72b
makes spellingLanguage setting no longer effective. To make it work one needs
to set explicit spelling language either in System Preferences or in spelling
panel upon each TextMate run (since this is getting reset after application
restart) - which is counter-intuitive, can be treated as regression and it is
vaguely described in ChangeLog:

 * Support spell checking being “automatic by language”. This is set via the
   spelling panel.

This change presents alternative approach, introducing new empty
spellingLanguage setting "" (which is now default), which makes use system
panel language setting, including “automatic by language”.

From now on all files will be checked against system panel selected language
(or automatic), unless .tm_properties project specifies explicitly language for
given file using, eg.:

    [ locale-en_US.ini ]
    spellingLanguage = en_US

    [ locale-pl_PL.ini ]
    spellingLanguage = pl_PL

Or automatically depending on file name:

    [ locale-*.ini ]
    spellingLanguage = '${TM_FILEPATH/^.*locale-([a-z]+_[A-Z]+).*$/$1/}'
2016-01-29 08:46:18 +07:00
Allan Odgaard
8fe7681ebd Remove unnecessary include of oak/compat.h 2015-08-05 12:31:20 +02:00
Allan Odgaard
40879d5683 Replace sizeofA macro with range-based for loop or std::begin/end 2015-03-05 16:38:09 +07:00
Allan Odgaard
439601b8b0 Introduce API to check if a file reader works on an “open” buffer 2015-01-29 14:35:34 +07:00
Allan Odgaard
29a576ffbe Don’t go via helper for pthread_setname_np
This was previously done because the function wasn’t available until 10.7, but since that is (now) our deployment target, there is no need to wrap the call.
2014-12-25 09:36:01 +01:00
Allan Odgaard
24c510bbd5 Add a “document will delete” callback function 2014-11-11 08:44:07 +01:00
Allan Odgaard
d3b0ef3677 Allow a string value to be stored with each mark (document) 2014-10-19 20:26:00 +02:00
Allan Odgaard
2cb480364f Asking for marks of any type now return both type and value
Previously we would only return the type.
2014-10-19 20:26:00 +02:00
Allan Odgaard
0d917f8f94 Allow a string value to be stored with each mark (buffer)
We were already storing a string for each mark but was (redundantly) using the mark type as value.
2014-10-19 20:25:59 +02:00
Allan Odgaard
405e627c18 Add test for wrong checksum passed to document::replace 2014-10-18 13:03:01 +02:00
Allan Odgaard
9c9de99418 Verify checksum when replacing in non-open documents
If the checksum does not match we simply skip the document and does not show the replacement as having been done (in the UI).
2014-10-18 13:03:01 +02:00
Allan Odgaard
60465ce465 Ask for bookmarks (instead of marks) and drop local filtering
Also rename the member function so it’s clear we only get the bookmarks (not all marks).
2014-10-16 13:53:30 +02:00
Allan Odgaard
ece4ca014a Preserve and adjust bookmarks when replacing in closed documents 2014-10-15 14:02:57 +02:00
Allan Odgaard
524d281046 Rework how marks are stored when there is no buffer_t 2014-10-15 13:51:00 +02:00
Allan Odgaard
b20629d9a1 Use public constant for bookmark identifier 2014-10-15 10:31:22 +02:00
Allan Odgaard
bb6206608b Use text::pos_t as key when storing marks for closed documents
Since open documents only support a single position (not a range) it doesn’t make sense to use a range for closed documents.
2014-10-14 22:53:10 +02:00
Allan Odgaard
c341765fe9 Add API to remove (all) marks from (all) documents 2014-10-14 22:06:32 +02:00
Allan Odgaard
7724abb022 Cleanup code dealing with marks
Previously marks were lost when disposing a document.
2014-10-13 23:20:25 +02:00
Allan Odgaard
fc09b3c0c6 Use std::string instead of document_t::mark_t
This is consistent with the marks kept by buffer_t.
2014-10-12 11:46:19 +02:00
Allan Odgaard
012a700429 Allow clearing the (cached) content of a non-open document 2014-10-08 21:52:27 +02:00
Allan Odgaard
8322954ec9 Ignore extended attribute storing foldings if content has changed 2014-10-07 18:24:27 +02:00
Allan Odgaard
c0c7f04a10 Only retrieve encoding settings during save when they are missing
Previously we would also retrieve settings for untitled documents, but we now rely on untitled documents getting their encoding settings from the choice made in the save panel.
2014-10-06 20:42:42 +02:00
Allan Odgaard
44b8d5986f Go via set_disk_encoding member function 2014-10-06 20:42:42 +02:00
Allan Odgaard
6928505062 Only set encoding settings (post open) for documents with a path 2014-10-06 20:42:38 +02:00
Allan Odgaard
5eb7ede829 Don’t ignore case changes on case-insensitive file systems 2014-09-26 23:10:24 +02:00
Allan Odgaard
651138d660 Update debug output 2014-09-16 14:54:11 +02:00
Allan Odgaard
9a3ab4c46f Add option to search linked files (rather than folders)
Also reworked API slightly to make things more explicit.
2014-09-14 18:17:00 +02:00
Allan Odgaard
7e63510cfd Document changed on disk would sometimes be marked as modified
We wrap the “update document” in an undo group, but if we already have an undo group at a higher level then our “end group” would be postponed to the root group, which would delay updating the document revision, and thus the revision we use as the disk revision would be wrong.

We workaround this by forcing the undo group to end and thus ignore the one at the higher level, which should be safe.
2014-09-02 18:59:29 +02:00
Allan Odgaard
b0d57705cf Make encoding part of the document_t::reader_t API 2014-08-22 09:35:30 +02:00
Allan Odgaard
135667b655 Add file type extension to document backups 2014-07-29 23:48:37 +02:00
Allan Odgaard
e78764a89e Let threaded syntax highlight parsing for ng::buffer_t be opt-in 2014-06-28 17:42:23 +02:00
Allan Odgaard
e81286b0cd Remove unused include 2014-05-16 22:11:28 +07:00
Allan Odgaard
af3f4aaa33 Check result of most CF/CT ‘Create’ functions 2014-05-15 13:17:30 +07:00
Allan Odgaard
9a80fd4226 Fix potential stall using “save all” from find in folder
This would happen if the user manually saved one of the documents with replacements before invoking save all, since the wrong “did save” callback was called when trying to save an unmodified document.
2014-04-28 21:45:59 +07:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00