mirror of
https://github.com/qvacua/vimr.git
synced 2024-09-11 17:15:34 +03:00
Compare commits
2 Commits
5193a32cdb
...
bfab09e3b7
Author | SHA1 | Date | |
---|---|---|---|
|
bfab09e3b7 | ||
|
d56803fafb |
@ -54,10 +54,10 @@ public extension NvimView {
|
|||||||
|
|
||||||
let mousescroll: String
|
let mousescroll: String
|
||||||
if event.hasPreciseScrollingDeltas { // trackpad
|
if event.hasPreciseScrollingDeltas { // trackpad
|
||||||
let (absDeltaX, absDeltaY) = (abs(deltaX), abs(deltaY))
|
let (absDeltaX, absDeltaY) = (abs(deltaX), abs(deltaY))
|
||||||
mousescroll = "ver:\(absDeltaY),hor:\(absDeltaX)"
|
mousescroll = "ver:\(absDeltaY),hor:\(absDeltaX)"
|
||||||
} else {
|
} else {
|
||||||
mousescroll = ""
|
mousescroll = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return self.api.nvimExecLua(code: """
|
return self.api.nvimExecLua(code: """
|
||||||
@ -81,8 +81,8 @@ public extension NvimView {
|
|||||||
end)
|
end)
|
||||||
""", args: [MessagePackValue(mousescroll), MessagePackValue(vimInput)])
|
""", args: [MessagePackValue(mousescroll), MessagePackValue(vimInput)])
|
||||||
.subscribe(onFailure: { [weak self] error in
|
.subscribe(onFailure: { [weak self] error in
|
||||||
self?.log.error("Error in \(#function): \(error)")
|
self?.log.error("Error in \(#function): \(error)")
|
||||||
})
|
})
|
||||||
.disposed(by: self.disposeBag)
|
.disposed(by: self.disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,18 +220,18 @@ public extension NvimView {
|
|||||||
|
|
||||||
let resultX: String
|
let resultX: String
|
||||||
if deltaX == 0 {
|
if deltaX == 0 {
|
||||||
resultX = ""
|
resultX = ""
|
||||||
} else {
|
} else {
|
||||||
let wheel = (deltaX < 0) ? "ScrollWheelRight" : "ScrollWheelLeft"
|
let wheel = (deltaX < 0) ? "ScrollWheelRight" : "ScrollWheelLeft"
|
||||||
resultX = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
resultX = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
||||||
}
|
}
|
||||||
|
|
||||||
let resultY: String
|
let resultY: String
|
||||||
if deltaY == 0 {
|
if deltaY == 0 {
|
||||||
resultY = ""
|
resultY = ""
|
||||||
} else {
|
} else {
|
||||||
let wheel = (deltaY < 0) ? "ScrollWheelDown" : "ScrollWheelUp"
|
let wheel = (deltaY < 0) ? "ScrollWheelDown" : "ScrollWheelUp"
|
||||||
resultY = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
resultY = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
||||||
}
|
}
|
||||||
|
|
||||||
return "\(resultX)\(resultY)"
|
return "\(resultX)\(resultY)"
|
||||||
|
@ -109,7 +109,7 @@ extension NvimView {
|
|||||||
throw RxNeovimApi.Error.exception(message: "Incompatible neovim version.")
|
throw RxNeovimApi.Error.exception(message: "Incompatible neovim version.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// swiftformat:disable all
|
// swiftformat:disable all
|
||||||
let vimscript = """
|
let vimscript = """
|
||||||
function! GetHiColor(hlID, component)
|
function! GetHiColor(hlID, component)
|
||||||
let color = synIDattr(synIDtrans(hlID(a:hlID)), a:component)
|
let color = synIDattr(synIDtrans(hlID(a:hlID)), a:component)
|
||||||
|
@ -94,7 +94,8 @@ public extension NvimView {
|
|||||||
public var foreground = NSColor.textColor
|
public var foreground = NSColor.textColor
|
||||||
public var background = NSColor.textBackgroundColor
|
public var background = NSColor.textBackgroundColor
|
||||||
|
|
||||||
public var visualForeground: NSColor = NSColor(named: NSColor.Name("controlAccentColor")) ?? .selectedMenuItemTextColor
|
public var visualForeground: NSColor =
|
||||||
|
.init(named: NSColor.Name("controlAccentColor")) ?? .selectedMenuItemTextColor
|
||||||
// NSColor.selectedMenuItemTextColor
|
// NSColor.selectedMenuItemTextColor
|
||||||
// NSColor.selectedMenuItemColor is deprecated. The doc says that
|
// NSColor.selectedMenuItemColor is deprecated. The doc says that
|
||||||
// NSVisualEffectView.Material.selection should be used instead, but I don't know how to get
|
// NSVisualEffectView.Material.selection should be used instead, but I don't know how to get
|
||||||
@ -135,9 +136,10 @@ public extension NvimView {
|
|||||||
self.tabBackground = values[7] < 0 ? Theme.default.tabBackground : color(values[7])
|
self.tabBackground = values[7] < 0 ? Theme.default.tabBackground : color(values[7])
|
||||||
self.tabForeground = values[8] < 0 ? Theme.default.tabForeground : color(values[8])
|
self.tabForeground = values[8] < 0 ? Theme.default.tabForeground : color(values[8])
|
||||||
|
|
||||||
self.selectedTabBackground = values[9] < 0 ? Theme.default.selectedTabBackground : color(values[9])
|
self.selectedTabBackground = values[9] < 0 ? Theme.default
|
||||||
self.selectedTabForeground = values[10] < 0 ? Theme.default.selectedTabForeground : color(values[10])
|
.selectedTabBackground : color(values[9])
|
||||||
|
self.selectedTabForeground = values[10] < 0 ? Theme.default
|
||||||
|
.selectedTabForeground : color(values[10])
|
||||||
}
|
}
|
||||||
|
|
||||||
public var description: String {
|
public var description: String {
|
||||||
|
@ -356,7 +356,6 @@ final class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDe
|
|||||||
case 1: .withFontSmoothing
|
case 1: .withFontSmoothing
|
||||||
case 2: .noFontSmoothing
|
case 2: .noFontSmoothing
|
||||||
case 3: .noAntiAliasing
|
case 3: .noAntiAliasing
|
||||||
|
|
||||||
default: .systemSetting
|
default: .systemSetting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,6 @@ final class HttpServerMiddleware {
|
|||||||
case .bufferWritten: fallthrough
|
case .bufferWritten: fallthrough
|
||||||
case .setTheme:
|
case .setTheme:
|
||||||
break
|
break
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,6 @@ final class MarkdownPreviewMiddleware {
|
|||||||
case .bufferWritten: fallthrough
|
case .bufferWritten: fallthrough
|
||||||
case .setTheme:
|
case .setTheme:
|
||||||
self.generator.apply(result.state, uuid: uuidAction.uuid)
|
self.generator.apply(result.state, uuid: uuidAction.uuid)
|
||||||
|
|
||||||
default: return result
|
default: return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ struct Theme: CustomStringConvertible {
|
|||||||
var cssCodeColor = NSColor(hex: "24292e")!
|
var cssCodeColor = NSColor(hex: "24292e")!
|
||||||
var cssCodeBackgroundColor = NSColor(hex: "1b1f23")!
|
var cssCodeBackgroundColor = NSColor(hex: "1b1f23")!
|
||||||
|
|
||||||
public var description: String {
|
public var description: String {
|
||||||
"Theme<" +
|
"Theme<" +
|
||||||
"fg: \(self.foreground.hex), bg: \(self.background.hex), " +
|
"fg: \(self.foreground.hex), bg: \(self.background.hex), " +
|
||||||
"hl-fg: \(self.highlightForeground.hex), hl-bg: \(self.highlightBackground.hex), " +
|
"hl-fg: \(self.highlightForeground.hex), hl-bg: \(self.highlightBackground.hex), " +
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
# Next
|
# Next
|
||||||
|
|
||||||
|
* ...
|
||||||
|
|
||||||
|
# v0.47.3-20240616.090032
|
||||||
|
|
||||||
* GH-1072: Match the tab colors 1:1 with Neovim's `colorscheme`; thanks @s-daveb for the PR!
|
* GH-1072: Match the tab colors 1:1 with Neovim's `colorscheme`; thanks @s-daveb for the PR!
|
||||||
* GH-1073: Scroll the window content instead of moving the cursor; thanks @shanesmith for the PR!
|
* GH-1073: Scroll the window content instead of moving the cursor; thanks @shanesmith for the PR!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user