Commit Graph

29 Commits

Author SHA1 Message Date
Allan Odgaard
15a15e8c15 Remove prototype for unimplemented member function 2013-08-24 01:19:29 +02:00
Allan Odgaard
2c0010a141 Restore “first visible character” instead of visible rectangle
This is when switching tabs ore re-opening a file.

Restoring the visible rectangle doesn’t always work because we do an initial heuristic layout where we don’t do proper soft wrap and may also lack scoped settings to increase font size for headings, meaning that the restored visible rectangle does not point to the same section of the text, as it would with a fully updated layout.

This fixes #243.
2013-08-04 14:36:45 +02:00
Allan Odgaard
1d4d3bd3d3 Fix path/inode lookup when opening documents
The strategy is to prefer an existing document with same path and if there is none, check if there is a document with the same inode. The latter is so that links or files that have been moved, do not create duplicate documents.

The old code used a single map for the lookup, using path::identifier_t as key (wrapping path and/or inode), though since the map is ordered, the code would occasionally fail, as the keys cannot be correctly ordered (so effectively this reworked code is a fix for an incorrect path::identifier_t::operator<).

Fixes #1052.
2013-07-30 15:34:17 +02:00
Allan Odgaard
a05088f9be Document from content now sets file type and tab settings
Presently we also set file type (and thus indirectly indent settings) when “opening” a document, but I wish to remove that code, so that one can create a document, set all desired settings, and not worry about later code overwriting these settings.
2013-07-29 13:56:15 +02:00
Allan Odgaard
2ad22d7662 Add indent accessor to document_t 2013-07-29 10:11:51 +02:00
Allan Odgaard
98585e166e Use byte range for replacement API 2013-07-27 16:30:02 +02:00
Allan Odgaard
2c307cabce Allow setting a tab as “sticky”
Presently this can only be done by right-clicking the tab and selecting the “Sticky” option — if a tab is sticky then it will not be closed when executing any of the batch close actions (Close All Tabs, Close Other Tabs, Close Tabs to the Right, and holding option down while opening a file via file browser or file chooser).

Closes #1038.
2013-07-21 13:25:28 +02:00
Allan Odgaard
a366a5f9fe Move grammar changed callback from document → buffer 2013-05-15 15:45:36 +07:00
Allan Odgaard
6e4926177e Provide symmetric content/set_content for document_t 2013-05-15 15:45:36 +07:00
Allan Odgaard
f5c63828ee Remove path attributes from document_t 2013-05-12 23:04:57 +07:00
Allan Odgaard
e5cca3de18 Remove ‘document_settings’ API 2013-05-12 11:09:18 +07:00
Allan Odgaard
4a32881c11 Remove legacy variable functions 2013-05-12 11:09:17 +07:00
Allan Odgaard
7f4649ba32 Factor out deprecated variable collecting 2013-05-12 11:09:15 +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
e6a4254e61 Allow excluding untitled documents from document::scanner_t
The problem with this feature is that it includes all untitled documents including e.g. the current bundle item being edited. For things like ⌘T we only want to show untitled documents from the current window.
2013-01-18 05:46:27 +01:00
Allan Odgaard
8611aa3f11 Introduce document_t::detach_backup
This will reset the document’s backup path but not delete the backup on disk (which can be found via the document’s identifier).

This is useful if we wish to dispose the document but reconstruct it later (e.g. during application termination).
2013-01-16 04:42:51 +01:00
Allan Odgaard
a9745164c7 Exclude backups from document::find by default 2013-01-12 13:09:16 +01:00
Allan Odgaard
821be6acad Custom named documents don’t occupy an untitled counter
Previously if the custom name was set before the display name was requested, it would not allocate an untitled counter, but if set later, it would (effectively) not release the counter already allocated.
2013-01-08 22:48:08 +01:00
Allan Odgaard
a0c4af64bd Remove trailing whitespace
Only removed from non-empty lines.
2012-09-25 14:16:50 +02:00
Allan Odgaard
48616a7ea1 Make document_t::scope private
Ideally should be removed entirely but as document presently does load/save where we need scopes (for import/export commands), we need it internally.
2012-09-18 19:38:01 +02:00
Allan Odgaard
8964971e98 Remove document_t::path_attributes 2012-09-18 19:38:01 +02:00
Allan Odgaard
4fc00f55e7 Update file scanner API to use glob_list_t 2012-09-12 18:30:36 +02:00
Allan Odgaard
b2fa6ff377 Remove UUID from settings API
Don’t recall what the intent was with this.
2012-09-11 00:05:05 +02:00
Allan Odgaard
45b00164c4 Move document::is_binary to where it is used 2012-09-10 14:24:04 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Allan Odgaard
6f45ee4a9c Use encoding::type for open related API 2012-08-26 17:06:38 +02:00
Allan Odgaard
d1de4a8854 Use encoding::type for save related API
There is also a new document_t::encoding_for_save_as_path which returns the encoding that would be used for the document, if saved at the given path. If the document was loaded from disk, it will return the encoding used during load, otherwise it will check tmProperties for which encoding should be used for the path provided. Save dialog for untitled documents will be pre-populated with the result of the above function.
2012-08-26 16:13:20 +02:00
Allan Odgaard
566d9b27dc Expose encoding variables for document_t 2012-08-21 23:45:45 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00