Virtually it's more correct that if `document_rename_file()` fails, `handle_save_as()` would no longer proceed to call `document_save_file_as()`. I'm not sure if unexpected things in runtime would not happen if `document_save_file_as()` somehow succeeds even if `document_rename_file()` fails, but it's certainly not what the user would be expecting. I.e., being able to save to the target file but the originally file remains to exist. This might be a rare case, but it still stands to be programmatically incorrect.
I decided to include changing `document_rename_file()` itself in this update rather than creating another non-API function, because I believe it's the only correct way to do it. Sooner or later, it would have to be changed anyway. And I don't think it's likeable that an old non-gboolean function which no code would use would exist just for the sake of not breaking the API. This should also be helpful to future code that might rely on it.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1180
-- Commit Summary --
* Make document_rename_file() return a gboolean.
* Abort save if rename fails
-- File Changes --
M src/dialogs.c (6)
M src/document.c (4)
M src/document.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/1180.patchhttps://github.com/geany/geany/pull/1180.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1180
As discussed in https://github.com/geany/geany/pull/1180.
This change adds two new functions: `document_rename_file_and_save()`, and `document_rename_and_save()`. `document_rename_file_and_save()` is kind of like the combination of `document_rename_file()` and `document_save_file_as()`, and is strictly about renaming the associated file, and doing the stuff necessary before and after the file has been renamed, like disabling file monitoring, and putting it back if a rename fails, saving/restoring file disk status, etc.
`document_rename_and_save()` OTOH is more of a wrapper, and is about renaming the document itself. It doesn't require the document to have an associated file to it (i.e. `doc->real_path != NULL`). But if there is an associated file, the file is also renamed, i.e., `document_rename_file_and_save()` is called. The algorithm to check if the file has to be overwritten is also contained in it. This function should be adaptable to other implementations like [in-place renaming](https://github.com/konsolebox/geany/tree/docs_rename).
In `dialogs.c`, stuff about resetting `doc->tm_file` and calling `build_menu_update()` has been moved to `document_save_file_as()`, since both are essentially needed to be done by anyone that calls the function. It helps significantly simplify the two new functions and the functions in `dialogs.c`.
The function `save_as_dialog_handle_response()` has been refactored, and is now simpler since the "overwrite file?" prompt has been moved to `document_rename_and_save()`, and since it can now directly call `document_rename_and_save()` and `document_save_file_as()`. `dialogs_show_save_as()` now also directly calls `document_save_file_as()` if `interface_prefs.use_native_windows_dialogs == TRUE`. `handle_save_as()` is no longer needed, so it's been removed.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1194
-- Commit Summary --
* Add document_rename_file_and_save()
* Do not make document_rename_file_and_save() an API function for now
* Add document_rename_and_save()
* Move resetting GeanyDocument::tm_file, and calling build_menu_update() to document_save_file_as()
* Rework Save-As functions in dialogs.c
* dialogs_show_save_as: g_free(utf8_name);
-- File Changes --
M src/dialogs.c (78)
M src/document.c (81)
M src/document.h (4)
-- Patch Links --
https://github.com/geany/geany/pull/1194.patchhttps://github.com/geany/geany/pull/1194.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1194
I copied and pasted the following code from [trojan-source](https://github.com/nickboucher/trojan-source/blob/main/C/com…
![geany-right-to-left](https://user-images.githubusercontent.com/1738012/140482937-700db336-355f-4df8-9c19-08b50d0e265a.png)
As you see, line 6 is not rendered properly.
The curly braces inside RLI are unreachable by mouse or arrow keys movements.
When the same code is saved as text, the curly brace on line 8 changes from close to open as the cursor moves to the curly brace on line 9.
And, yes, there are [security concerns](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42574) involved. [Read more](https://www.trojansource.codes/)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2981
Until about a year ago, Geany used to not complain about read-only .geany files, which was the only clean way to prevent it from constantly updating the project file, without even asking whether to save the session or something along the way. Now it basically prevents you from doing work by constantly asking for confirmation that the .geany file is read-only.
Even before the dreadful change was introduced, I submitted a feature request for a program-level session-wise implementation (issue #2304), which is still open. In the meantime the situation has only worsened to what I'm proposing is accepted as a bug.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2863
As you know apple is planning to eliminate the Intel systems. In one/two years from now it would be very unlikely to see any Intel based Mac. Currently Geany doesn't even open in the M1 macs (or maybe it is the os 12 that is the problem), whatever it is, it would be so amazing to have the Geany back in the mac
![](https://user-images.githubusercontent.com/2157285/139278081-6f849cf0-7101-4933-ab76-54a8f3817465.png)
So my question is that do you have any roadmap for supporting the Apple Silicon?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2969
Geany currently constantly updates `.geany` project files with no option to choose in which state to save the session (and consequently also have an ability for project-wise presets/defaults). This is leading to issues such as #2304 and #2863.
This is a feature request for additional global option under `Preferences > General > Miscellaneous > Projects` so one can disable session autosaving and also add a manual option to do so, probably something along the lines of `File > Save Project`.
Also: Another option in the category _Use project-based session files_ disables using `.geany` files altogether and is not helpful in the case.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2864
This adds an option to hide the warning that is displayed when opening a project while one is already open. The default setting is to show the warning (current behavior).
Since projects autosave when closed, no work is lost and the project can just be reopened if needed. Depending on how the user manages project files, reopening the previous project can take less time than responding to the dialog.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2949
-- Commit Summary --
* <a href="https://github.com/geany/geany/pull/2949/commits/cc2bb6b94de5e17e03d4cc10bf…">Add option to hide project close/save warning when opening new project</a>
-- File Changes --
A po/.intltool-merge-cache.lock (0)
M src/project.c (3)
M src/ui_utils.c (2)
M src/ui_utils.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/2949.patchhttps://github.com/geany/geany/pull/2949.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2949
This PR expands the zoom range of the zoom keybindings.
* Zooming via scroll wheel is unaffected (-10 to +20).
* Zoom in is "unlimited". (But everyone stops zooming eventually.)
* Zoom out stops when the font size reaches 2pt (limited by scintilla). Current behavior is to zoom out to -10 even when the font size doesn't change. So for a base font size of 10pt, the current behavior has the last three zoom levels (-8, -9, -10) set at 2pt. This PR stops at -8. But if the base font size is 16pt, zoom out with this PR continues to -14.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2955
-- Commit Summary --
* <a href="https://github.com/geany/geany/pull/2955/commits/58dfdd068b7e273d32b9062dd3…">Expand range of zoom keybindings</a>
-- File Changes --
M src/sciwrappers.c (16)
-- Patch Links --
https://github.com/geany/geany/pull/2955.patchhttps://github.com/geany/geany/pull/2955.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2955