mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-28 11:35:35 +03:00
79f34463a2
- make things open when nec'.
39 lines
930 B
Swift
39 lines
930 B
Swift
/**
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
* See LICENSE
|
|
*/
|
|
|
|
import Cocoa
|
|
|
|
// The definition can be found in NeoVimUiBridgeProtocol.h
|
|
|
|
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
|
|
}
|
|
|
|
func != (left: CellAttributes, right: CellAttributes) -> Bool {
|
|
return !(left == right)
|
|
}
|
|
|
|
extension CellAttributes: CustomStringConvertible {
|
|
|
|
public var description: String {
|
|
return "CellAttributes<fg: \(String(format: "%x", self.foreground)), bg: \(String(format: "%x", self.background)))"
|
|
}
|
|
|
|
public var inverted: CellAttributes {
|
|
var result = self
|
|
|
|
result.background = self.foreground
|
|
result.foreground = self.background
|
|
|
|
return result
|
|
}
|
|
}
|