mirror of
https://github.com/qvacua/vimr.git
synced 2024-08-17 20:50:22 +03:00
Compare commits
2 Commits
5193a32cdb
...
bfab09e3b7
Author | SHA1 | Date | |
---|---|---|---|
|
bfab09e3b7 | ||
|
d56803fafb |
@ -54,10 +54,10 @@ public extension NvimView {
|
||||
|
||||
let mousescroll: String
|
||||
if event.hasPreciseScrollingDeltas { // trackpad
|
||||
let (absDeltaX, absDeltaY) = (abs(deltaX), abs(deltaY))
|
||||
mousescroll = "ver:\(absDeltaY),hor:\(absDeltaX)"
|
||||
let (absDeltaX, absDeltaY) = (abs(deltaX), abs(deltaY))
|
||||
mousescroll = "ver:\(absDeltaY),hor:\(absDeltaX)"
|
||||
} else {
|
||||
mousescroll = ""
|
||||
mousescroll = ""
|
||||
}
|
||||
|
||||
return self.api.nvimExecLua(code: """
|
||||
@ -81,8 +81,8 @@ public extension NvimView {
|
||||
end)
|
||||
""", args: [MessagePackValue(mousescroll), MessagePackValue(vimInput)])
|
||||
.subscribe(onFailure: { [weak self] error in
|
||||
self?.log.error("Error in \(#function): \(error)")
|
||||
})
|
||||
self?.log.error("Error in \(#function): \(error)")
|
||||
})
|
||||
.disposed(by: self.disposeBag)
|
||||
}
|
||||
|
||||
@ -220,18 +220,18 @@ public extension NvimView {
|
||||
|
||||
let resultX: String
|
||||
if deltaX == 0 {
|
||||
resultX = ""
|
||||
resultX = ""
|
||||
} else {
|
||||
let wheel = (deltaX < 0) ? "ScrollWheelRight" : "ScrollWheelLeft"
|
||||
resultX = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
||||
let wheel = (deltaX < 0) ? "ScrollWheelRight" : "ScrollWheelLeft"
|
||||
resultX = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
||||
}
|
||||
|
||||
let resultY: String
|
||||
if deltaY == 0 {
|
||||
resultY = ""
|
||||
resultY = ""
|
||||
} else {
|
||||
let wheel = (deltaY < 0) ? "ScrollWheelDown" : "ScrollWheelUp"
|
||||
resultY = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
||||
let wheel = (deltaY < 0) ? "ScrollWheelDown" : "ScrollWheelUp"
|
||||
resultY = self.wrapNamedKeys("\(vimModifiers)\(wheel)") + vimMouseLocation
|
||||
}
|
||||
|
||||
return "\(resultX)\(resultY)"
|
||||
|
@ -109,7 +109,7 @@ extension NvimView {
|
||||
throw RxNeovimApi.Error.exception(message: "Incompatible neovim version.")
|
||||
}
|
||||
|
||||
// swiftformat:disable all
|
||||
// swiftformat:disable all
|
||||
let vimscript = """
|
||||
function! GetHiColor(hlID, component)
|
||||
let color = synIDattr(synIDtrans(hlID(a:hlID)), a:component)
|
||||
|
@ -94,7 +94,8 @@ public extension NvimView {
|
||||
public var foreground = NSColor.textColor
|
||||
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.selectedMenuItemColor is deprecated. The doc says that
|
||||
// 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.tabForeground = values[8] < 0 ? Theme.default.tabForeground : color(values[8])
|
||||
|
||||
self.selectedTabBackground = values[9] < 0 ? Theme.default.selectedTabBackground : color(values[9])
|
||||
self.selectedTabForeground = values[10] < 0 ? Theme.default.selectedTabForeground : color(values[10])
|
||||
|
||||
self.selectedTabBackground = values[9] < 0 ? Theme.default
|
||||
.selectedTabBackground : color(values[9])
|
||||
self.selectedTabForeground = values[10] < 0 ? Theme.default
|
||||
.selectedTabForeground : color(values[10])
|
||||
}
|
||||
|
||||
public var description: String {
|
||||
|
@ -356,7 +356,6 @@ final class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDe
|
||||
case 1: .withFontSmoothing
|
||||
case 2: .noFontSmoothing
|
||||
case 3: .noAntiAliasing
|
||||
|
||||
default: .systemSetting
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,6 @@ final class HttpServerMiddleware {
|
||||
case .bufferWritten: fallthrough
|
||||
case .setTheme:
|
||||
break
|
||||
|
||||
default:
|
||||
return result
|
||||
}
|
||||
|
@ -194,7 +194,6 @@ final class MarkdownPreviewMiddleware {
|
||||
case .bufferWritten: fallthrough
|
||||
case .setTheme:
|
||||
self.generator.apply(result.state, uuid: uuidAction.uuid)
|
||||
|
||||
default: return result
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ struct Theme: CustomStringConvertible {
|
||||
var cssCodeColor = NSColor(hex: "24292e")!
|
||||
var cssCodeBackgroundColor = NSColor(hex: "1b1f23")!
|
||||
|
||||
public var description: String {
|
||||
public var description: String {
|
||||
"Theme<" +
|
||||
"fg: \(self.foreground.hex), bg: \(self.background.hex), " +
|
||||
"hl-fg: \(self.highlightForeground.hex), hl-bg: \(self.highlightBackground.hex), " +
|
||||
|
@ -1,5 +1,9 @@
|
||||
# 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-1073: Scroll the window content instead of moving the cursor; thanks @shanesmith for the PR!
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user