Files

22 lines
631 B
Swift

import Foundation
/// The view the editor shows for the open file. Raw values are stored in sessions, so `.actual` stays "updated".
///
/// `.diff` is the full-screen side-by-side overlay, not a pane mode.
public enum ViewMode: String, Codable, Sendable, CaseIterable {
/// The live buffer with changed lines marked.
case actual = "updated"
case diff
/// An unchanged file: the plain editable buffer.
case code
/// Rendered Markdown.
case preview
public init(_ mode: DefaultDiffMode) {
switch mode {
case .updated: self = .actual
case .diff: self = .diff
}
}
}