Zren / atom-open-recent

https://atom.io/packages/open-recent
25 stars 10 forks source link

Move 'open-recent' list out of 'config.cson' and into its own 'open-recent.cson' file #12

Open austincrft opened 8 years ago

austincrft commented 8 years ago

I store all my Atom configuration files in a dotfiles repo so that I can sync it across different machines. Because the open-recent list is machine-specific, I don't think it's something that belongs in the config.cson.

As of now, my config.cson is showing up as modified in my git repo every time I open a file.

image

Zren commented 8 years ago

Bleh. Didn't think about this use case. I was using local storage before since this isn't configuration really but data. Can you name any other plugins that have their own config file? Otherwise I'll go back to local storage.

jerone commented 8 years ago

The feature to change folders and files in Atom settings is very useful! But adding this to the config.cson wasn't my first preference too. I sync my config.cson (and other files) to other computers I've running, overriding any files and folders I've used there.

As for an example of another package that has their own config file, Flex Tool Bar is one.

Zren commented 8 years ago

Hmm. Looks like flex-toolbar depends on the CSON package. Was hoping for something I didn't see in the atom API. Their implementation doesn't use the observe() pattern which means I'd have to copy most of Atom's Config class in order to move this to it's own file (This is required to signal other windows).

This plugin's footprint is suppose to be small so I don't really want to write my own config file i/o implementation. Back to localStorage it is.

Edit

Moved back to localStorage. Will consider making a submenu to allow users to delete a specific entry.

Comparison of pre config.cson and post config.cson code for reference since there are some changes I kept so I didn't just rollback and bump the version number.

https://github.com/Zren/atom-open-recent/compare/ae0203aae965754c83c55d3addcfca79a7f076e6...acc8df0c14f8665deb2622d7b87a2d2097245230?w=1

jerone commented 8 years ago

I still believe the feature to remove individual items for the recent list is useful. Moving back to localstorage makes that feature hard to do. I like the suggestion to move all files and folders to CSON/JSON/JSON5 or any other filetype for easy access, overview and edit.

austincrft commented 8 years ago

The package-sync plugin uses a packages.cson file, but I haven't looked through the code to see if they're handling it any easier.