mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-29 16:56:40 +03:00
Refactor slightly
This commit is contained in:
parent
ffd95012e7
commit
f960183cb2
@ -48,15 +48,12 @@ class PreviewUtils {
|
||||
return self.state(for: .none, baseUrl: baseUrl)
|
||||
}
|
||||
|
||||
var result = PreviewState(status: .markdown,
|
||||
return PreviewState(status: .markdown,
|
||||
buffer: url,
|
||||
html: self.htmlUrl(with: uuid),
|
||||
server: self.serverUrl(for: uuid, baseUrl: baseUrl, lastComponent: "index.html"))
|
||||
|
||||
result.editorPosition = editorPosition
|
||||
result.previewPosition = previewPosition
|
||||
|
||||
return result
|
||||
server: self.serverUrl(for: uuid, baseUrl: baseUrl, lastComponent: "index.html"),
|
||||
editorPosition: editorPosition,
|
||||
previewPosition: previewPosition)
|
||||
}
|
||||
|
||||
fileprivate static func serverUrl(for uuid: String, baseUrl: URL, lastComponent: String) -> URL {
|
||||
|
@ -140,24 +140,23 @@ struct PreviewState {
|
||||
|
||||
var editorPosition = Marked(Position.beginning)
|
||||
var previewPosition = Marked(Position.beginning)
|
||||
|
||||
// FIXME: delete the followin?
|
||||
// var ignoreNextForward = false
|
||||
// var ignoreNextReverse = false
|
||||
// var forceNextReverse = false
|
||||
|
||||
var lastSearch = SearchAction.none
|
||||
|
||||
init(status: Status = .none,
|
||||
buffer: URL? = nil,
|
||||
html: URL? = nil,
|
||||
server: URL? = nil,
|
||||
updateDate: Date = Date()) {
|
||||
updateDate: Date = Date(),
|
||||
editorPosition: Marked<Position> = Marked(.beginning),
|
||||
previewPosition: Marked<Position> = Marked(.beginning)
|
||||
) {
|
||||
self.status = status
|
||||
self.buffer = buffer
|
||||
self.html = html
|
||||
self.server = server
|
||||
self.updateDate = updateDate
|
||||
self.editorPosition = editorPosition
|
||||
self.previewPosition = previewPosition
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user