mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-25 14:13:04 +03:00
36 lines
880 B
Swift
36 lines
880 B
Swift
/**
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
* See LICENSE
|
|
*/
|
|
|
|
import Cocoa
|
|
|
|
// The definition can be found in NeoVimUiBridgeProtocol.h
|
|
|
|
extension CellAttributes: CustomStringConvertible, Equatable {
|
|
|
|
public static func ==(left: CellAttributes, right: CellAttributes) -> Bool {
|
|
if left.foreground != right.foreground { return false }
|
|
if left.fontTrait != right.fontTrait { return false }
|
|
|
|
if left.background != right.background { return false }
|
|
if left.special != right.special { return false }
|
|
|
|
return true
|
|
}
|
|
|
|
public var description: String {
|
|
return "CellAttributes<fg: \(String(self.foreground, radix: 16)), " +
|
|
"bg: \(String(self.background, radix: 16)))>"
|
|
}
|
|
|
|
public var inverted: CellAttributes {
|
|
var result = self
|
|
|
|
result.background = self.foreground
|
|
result.foreground = self.background
|
|
|
|
return result
|
|
}
|
|
}
|