This copies the current document text and properties into a new
document, similar to the old Save As 'Open file in a new tab'
option, but easier to understand and decoupled from saving.
One notable difference is that the new document does not copy the
filename - the old behaviour was confusing and error-prone for the
user (e.g. editing two documents with the same filename).
This reverts commit 7cc443e1420b77d041815a464fe5b20bc62412f4.
Showing the truncation message only when the file exists doesn't work
when writing to a network file and the connection drops out (thanks to
Lex).
When switching between MRU documents, Geany pops up a dialog about
document change even for the intermediate non-final documents.
This leads to both reload dialog and document switch dialog displayed
at the same time and termination of document switching because the
newly displayed dialog takes focus.
This patch disables reload checks for the intermediate documents and
forces reload check for the final document.
Most noteworthy change is that all build commands IDs and groups are
now unsigned everywhere negative values aren't explicitly handled with
a special meaning. This should not change anything in behavior, only
makes clear the index won't underflow.
This adds a new commandline option --read-only (or -r). It's implemented
according to the behavior agreed on on the mailing list:
--read-only applies to all files on the command line
irrespective of positioning and has no effect on any other files
opened by session or menu (...)
Current behaviour on attempting to re-open a file with different
read-only status is that nothing happens, the already open
file is raised but not changed. (...)
* Add new function: document_update_tags().
* Refactor the various tag update functions into document_update_tags().
* Remove extra call to update the tags in document_new_file().
This prevents GTK of trying to fetch the necessary information like
MIME-type itself, which leads to a significant speedup (> 30%), as
well as using the real MIME-type we use rather than the GIO-guessed
one.
This function was only used from document_create() and most of this code is
not needed since the memset() and g_new0() calls set the memory to all 0's,
which in this case should suffice to (re)set all the members to 0/NULL/FALSE.
Refactor so all the resetting to defaults code is done in remove_page()
only and then only do the required non-FALSE/NULL initialization in
document_create().
Move the remove_page() prototype to the top of the file and various other
minor changes in remove_page().
It was used only in one place in document_update_type_keywords() which
already did a similar check using the file type before calling this function.
Update HACKING file and very minor cleanup of other code in
document_update_type_keywords().
Previously an error message was shown if doc->file_name is NULL.
The Save As dialog is now shown if the document does not have an
absolute path. This is because the user should confirm where to save
the document in this case.
Although this changes plugin API behaviour, it seems the best way to
ensure the Save As dialog is always shown when needed so the user
knows where the document has been saved.
Fix correctly checking result of editor_lexer_get_type_keyword_idx().
Do not check IS_SCINTILLA unnecessarily (this is covered by DOC_VALID).
Do not use G_[UN]LIKELY macros as this complicates code without any
real benefit (unless in a tight loop).
Remove type keywords caching function since it doesn't really speed up
anything and we don't care if the keywords change since they can/should
still be reloaded. This also prevents "leaking" a static GString once
when the application closes and saves a call to g_string_free() when the
type keywords have changed.
Rename document_update_highlighting() to document_update_type_keywords()
since no re-highlighting is needed when updating Scintilla keywords.
Scintilla highlights the new keywords automatically so this saves a call
to queue_colourise().
Remove update_type_keywords() function since this is now all handled
in the document_update_type_keywords() function. This function had a
comment about updating all documents when sci is NULL but it was never
used in this way since it was only called on document_load_config() which
always operates on a single document and the sci should not be NULL.
Most notably, utils_get_line_endings() and document_open_file_list()
don't support -1 as the size anymore. If the size should be computed
from null-terminated data, the caller code must take care of doing so.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5855 ea778897-0a13-0410-b9d1-a72fbfd435f5