understand (and workaround) the geany editor "save session" behavior

Forum Forums antiX-development Documentation understand (and workaround) the geany editor "save session" behavior

  • This topic has 0 replies, 1 voice, and was last updated Nov 19-9:33 am by skidoo.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2779
    Member
    Avatarskidoo

    Because we are able to launch multiple concurrent instances of geany, the following quoted “bug” will probably never be fixed.
    (will probably wind up marked “is a feature, not a bug“)

    excerpt from a longstanding open bug report @geany package

    Geany saves its session state only when it shuts down cleanly of its own accord; when killed by a logout or reboot (or worse) its session restore returns it to an earlier state.

    Expected behavior:
    Geany should save session state either on a timed basis, or whenever anything significant changes (such as opening or closing tabs)

    The current behavior defeats the purpose of a saved session state, as the time you really need it is when your laptop crashes.

    If you click “Edit}}Preferences” in geany toolbar, you’ll notice that “Load files from last session” is checkmarked by default.

    If you click “Project” in geany toolbar (and read the geany docs), you’ll understand that we can declare a set of currently opened files as a project and that we can switch between filesets (projects) on-the-fly while using geany. The saved state even marks/reapplies the scrollto position within each document.

    If you assign the current set of documents to a named project, on-demand you can “Project}}Close” followed by “Project}}Open” to establish an updated session state for that project (without exiting geany), regardless whether or not the “Load files from last session” preference is enabled.

    Why should you care?
    man geany
    In the mapage, notice that geany can be invoked using -i , which serves to launch a new geany instance.
    In the antiX control center, notice that some (but not all) items invoke a new geany instance (for config file editing, and whatnot).

    If you are working on a set of files in geany (maybe geany is minimized at the moment and you’re not even thinking about)…

    When you duck into ControlCenter for a quick edit of your session startup file (e.g. “Edit fluxbox Settings”)
    upon closing that newest geany instance, the details (fileset and scrollto marks) of THAT instance become the “last saved” geany session state.

    In live-session, if you perform an on-demand “persist-save” operation while geany is open, consider:
    the details of your current geany sesssion haven’t yet been saved (so can’t be captured by the persist operation)

    Confusingly (for me), the “state” of saved geany projects has repeatedly wound up being overwritten by opening/closing additional instances of geany. Depending on your usage, UNticking the “Load files from last session” preference may be the sane choice if you intend to utilize the geany “Projects” feature. I have left the preference enabled but I go out of my way (?) to use an alternative editor (pluma, leafpad, bluefish) for quick OpenWith edits from within filemanager.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.