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.
This is only meant for when the document reloads content because the file was changed on disk. Long-term though, I think reloading document because of disk changes should be handled at a higher level.
When saving and the document needs to execute a command (e.g. callback.document.export) then we can no longer use our special run-loop mode, as command execution is now using queues, and queue dispatching is paused when running in a custom run-loop mode.
This resulted in missing proxy icon update e.g. when saving an untitled document over an existing one, as we would first set the path to the new location (and indirectly change the “is on disk” status without sending the proper notification).
Also skip checking for saved selection / visible index if there is no text in the buffer (since in this case, teh only valid values for seleciton / visible index are the default values).
This should be handled better, but previously we would crash due to filling the stack, so better to just immediately abort when we detect the problem, so that we get a better crash report and can see how widespread the issue is.
Previously if the file had been loaded as ASCII/UTF-8 and was changed on disk to something other than UTF-8, TextMate would go into infinite loop (retrying with UTF-8). It now uses the encoding classifier to find the most probable encoding (based on learned frequencies) falling back on ISO-8859-1, if there is no candidate.
Ideally it would bring up a warning, informing the user of the problem and allowing a manual correction of character set.
Fixes#1073.
This is to avoid cyclic dependencies since it was previously in a somewhat high-level framework, so everything that framework depended on, could not augment crash reports.
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.
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.
We now setup the indent settings when creating untitled documents where we know the folder, so that we can use potential settings scoped to that folder.
Since the document itself no longer sets this as part of regular buffer setup, we also set it when opening a document with a path, and when changing a document’s file type, although the latter is probably temporary.
Closes#305.
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.
The “find in folder” will create documents, set their content, and potentially save them.
If a document is not open, it should save it without going through the content examination for file type and similar, which is part of opening a non-open document.
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.