code: function saveLineFolds(editor) {
          var saveFolds = prefs.getSetting("saveFoldStates");
          if (!editor || !saveFolds) {
              return;
          }
          var folds = editor._codeMirror._lineFolds || {};
          var path = editor.document.file.fullPath;
          if (Object.keys(folds).length) {
              prefs.setFolds(path, folds);
          } else {
              prefs.setFolds(path, undefined);
          }
      }
docs: Saves the line folds in the editor using the preference storage
  @param {Editor} editor the editor whose line folds should be saved