31i73 / atom-dbg

An Atom package - An interactive debugger frontend
https://atom.io/packages/dbg
MIT License
30 stars 4 forks source link

correctly save selected debugger when updating debugger list #19

Closed vanossj closed 6 years ago

vanossj commented 7 years ago

removing a selected option results in a new option being selected and then subsequently saved as the 'selected' option before being removed.

Actual behavior is the the penultimate option would be set as the selected option regardless of what the original selected option was.

This patch only saves, and reselects, the first selected option.

However, in practice this function is only called when starting up, and 'automatic' is always the selected item coming out of this function. Checking for, saving, and maintaining the same selected option doesn't seem necessary.

ProPuke commented 6 years ago

Thanks vanossj! (Hey look I'm not dead!)

If a dbg provider is activated after initialisation this theoretically gets called again, so it does serve a purpose in theory. Although that's a very corner case (we only have 1 provider!).

Nonetheless working code is better than broken. Thank you!

ProPuke commented 6 years ago

Wait what.. I'd merged this already xD

Just.. didn't appear in this PR history? ¯\_(ツ)_/¯