SourceForge has been redesigned. Learn more.

#110 Fold States: Save across computers?


While this plugin saves fold states just fine on a given machine, what would it take to make it save fold states across machines/OS's?

I do some python programming at work and at home. I use DropBox to ensure I'm always sync'd to latest version. At work it's Windows, and home it's Ubuntu Linux. Currently, fold states saved at work are not remembered at home and vice versa.

Using latest 0.21 version of Geany.


  • William Fraser

    William Fraser - 2012-04-17
    • labels: 2909057 --> geanynumberedbookmarks
  • William Fraser

    William Fraser - 2012-04-17

    All information saved by the numbered bookmark plugin is saved in the plugins settings directory. On my version of Ubuntu it's in ~/.config/geany/plugins/Geany_Numbered_Bookmarks/settings.conf

    I'm not sure where it would be saved in windows, and I don't use dropbox so I don't know if would be possible to synchronise this settings file (which should be universal) between platforms.

    I would not go down the road of saving the bookmark, folding etc data in the file itself for compatibility reasons with other software that could use the source code that is most likely to be in the file.

    Two other options would be to have the settings saved in the same directory as the file they apply to either all in once file per directory (such as NumberedBookMarksPlugin.conf for example) or to have a file per file you're editing with the same name, but with some extension such as (.NBMP) Such files could then be synchronised with the file they apply to.

    You could have an option in the settings menu to specify where you want to save your settings: with the file or all centrally so users can decide how their version works.

    What do people think?

  • Chris Murphy

    Chris Murphy - 2012-04-17

    Good brainstorming ideas.

    On Windows XP, I see that the settings.conf is located in
    C:\Documents and Settings\username\Application Data\geany\plugins\Geany_Numbered_Bookmarks

    Dropbox works by looking for changes to files in a specified directory, such as in /home/user/username/DropBox.

    I can try tonight to see if placing that settings.conf in the DropBox dir and making links/shortcuts on each OS to that file will work or not. Does the settings.conf file get re-created at times, or is it only appended to? If appended to, this might work.

    Otherwise the idea of having the filename.nbmp in the same directory as source code (and on DropBox) would work, as it would be seen just like any other file.

    I agree that a user-defined setting (for settings.conf directory location) might be good. For most people who only work on one machine, they probably wouldn't mind settings.conf in the plugins directory you mention.

    I will try throwing settings.conf in the dropbox directory and linking to it, tonight.

  • Chris Murphy

    Chris Murphy - 2012-04-17

    I tried the following:

    -placed settings.conf from my Windows XP geany session into my dropbox folder on that PC
    - made a 'shortcut' from where settings.conf was (in geany plugins Geany_Numbered_Bookmarks dir) to that real file in the dropbox folder
    - on my Ubuntu PC, deleted settings.conf and also linked to the same settings.conf that was in my dropbox folder from Windows XP (same file as previous bullet, as both PCs have access to same file)

    When I fired up geany on Windows, it did not reload the fold states even though the settings.conf shortcut existed. When I refolded lines and resaved files, a new settings.conf file was created alongside the shortcut one.

    Ubuntu faired better. It too did not recognize folded states (more on that below), but when I refolded lines and saved my file, it did append to the linked settings.conf in the dropbox folder. So that settings.conf file contained fold states for the same file on different machines.

    The bigger issue I discovered is that the plugin stores the full pathname to file in the settings.conf file. Since I am sharing/syncing a file across two different PCs via dropbox, but the paths to the dropbox folders are unique on each PC (one Windows, one Ubuntu) the plugin will create a fold state pathname for the same file for each machine.

    So this sounds a little more complex. You would need a user setting to say, "treat multiple pathnames for same filename as one file" or something.

    The other issue is that the 'shortcut' did not seem to work for Windows (surprise), even though the link did for Ubuntu. This seems to imply the plugin might just have to store the fold state settings.conf file in the source code directory instead of geany plugins directory so each machine can see actual settings.conf file (in each machine's unique dropbox directory).


  • William Fraser

    William Fraser - 2012-07-16

    now settings can be saved in ascociated file

  • William Fraser

    William Fraser - 2012-07-16
    • status: open --> closed