mirror of
https://github.com/qvacua/vimr.git
synced 2024-09-11 17:15:34 +03:00
Compare commits
9 Commits
724d305168
...
99be0d8f8c
Author | SHA1 | Date | |
---|---|---|---|
|
99be0d8f8c | ||
|
32660845b9 | ||
|
aa81394a22 | ||
|
8ab37f908e | ||
|
82b2913aad | ||
|
a3a72c0770 | ||
|
57f22ac1ac | ||
|
e0e1dc1456 | ||
|
2145f0e84f |
@ -1 +1 @@
|
||||
Subproject commit f42fde64d27b4e4470159cf54440c6c6c0f72907
|
||||
Subproject commit 243b300a33e2fef31b00772aef6c5fb41d907118
|
@ -68,11 +68,25 @@ extension NvimView {
|
||||
return
|
||||
}
|
||||
|
||||
let (absDeltaX, absDeltaY) = (
|
||||
min(Int(ceil(abs(deltaX) / self.trackpadScrollResistance)), maxScrollDeltaX),
|
||||
min(Int(ceil(abs(deltaY) / self.trackpadScrollResistance)), maxScrollDeltaY)
|
||||
if event.phase == .began {
|
||||
self.trackpadScrollDeltaX = 0
|
||||
self.trackpadScrollDeltaY = 0
|
||||
}
|
||||
|
||||
self.trackpadScrollDeltaX += deltaX
|
||||
self.trackpadScrollDeltaY += deltaY
|
||||
let (deltaCellX, deltaCellY) = (
|
||||
(self.trackpadScrollDeltaX / self.cellSize.width).rounded(.toNearestOrEven),
|
||||
(self.trackpadScrollDeltaY / self.cellSize.height).rounded(.toNearestOrEven)
|
||||
)
|
||||
let (horizSign, vertSign) = (deltaX > 0 ? 1 : -1, deltaY > 0 ? 1 : -1)
|
||||
self.trackpadScrollDeltaX.formRemainder(dividingBy: self.cellSize.width)
|
||||
self.trackpadScrollDeltaY.formRemainder(dividingBy: self.cellSize.height)
|
||||
|
||||
let (absDeltaX, absDeltaY) = (
|
||||
min(Int(abs(deltaCellX)), maxScrollDeltaX),
|
||||
min(Int(abs(deltaCellY)), maxScrollDeltaY)
|
||||
)
|
||||
let (horizSign, vertSign) = (deltaCellX > 0 ? 1 : -1, deltaCellY > 0 ? 1 : -1)
|
||||
self.bridge
|
||||
.scroll(horizontal: horizSign * absDeltaX, vertical: vertSign * absDeltaY, at: cellPosition)
|
||||
.subscribe(onError: { [weak self] error in
|
||||
|
@ -59,8 +59,6 @@ public class NvimView: NSView,
|
||||
|
||||
public internal(set) var theme = Theme.default
|
||||
|
||||
public var trackpadScrollResistance = 5.0
|
||||
|
||||
public var usesLiveResize = false
|
||||
|
||||
public var usesLigatures = false {
|
||||
@ -285,6 +283,9 @@ public class NvimView: NSView,
|
||||
var scrollGuardCounterX = 5
|
||||
var scrollGuardCounterY = 5
|
||||
|
||||
var trackpadScrollDeltaX = 0.0
|
||||
var trackpadScrollDeltaY = 0.0
|
||||
|
||||
var isCurrentlyPinching = false
|
||||
var pinchTargetScale = 1.0
|
||||
var pinchBitmap: NSBitmapImageRep?
|
||||
|
@ -1153,7 +1153,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 20220416.182927;
|
||||
CURRENT_PROJECT_VERSION = 20220419.180005;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@ -1214,7 +1214,7 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 20220416.182927;
|
||||
CURRENT_PROJECT_VERSION = 20220419.180005;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@ -1243,7 +1243,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 20220416.182927;
|
||||
CURRENT_PROJECT_VERSION = 20220419.180005;
|
||||
DEFINES_MODULE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/.deps/include";
|
||||
IBC_MODULE = VimR;
|
||||
@ -1271,7 +1271,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 20220416.182927;
|
||||
CURRENT_PROJECT_VERSION = 20220419.180005;
|
||||
DEFINES_MODULE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/.deps/include";
|
||||
IBC_MODULE = VimR;
|
||||
|
@ -21,10 +21,6 @@ class AdvancedPrefReducer: ReducerType {
|
||||
state.mainWindowTemplate.drawsParallel = value
|
||||
state.mainWindows.keys.forEach { state.mainWindows[$0]?.drawsParallel = value }
|
||||
|
||||
case let .setTrackpadScrollResistance(value):
|
||||
state.mainWindowTemplate.trackpadScrollResistance = value
|
||||
state.mainWindows.keys.forEach { state.mainWindows[$0]?.trackpadScrollResistance = value }
|
||||
|
||||
case let .setUseInteractiveZsh(value):
|
||||
state.mainWindowTemplate.useInteractiveZsh = value
|
||||
|
||||
|
@ -13,7 +13,6 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
enum Action {
|
||||
case setUseInteractiveZsh(Bool)
|
||||
case setUseSnapshotUpdate(Bool)
|
||||
case setTrackpadScrollResistance(Double)
|
||||
case setUseLiveResize(Bool)
|
||||
case setDrawsParallel(Bool)
|
||||
}
|
||||
@ -31,7 +30,6 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
|
||||
self.useInteractiveZsh = state.mainWindowTemplate.useInteractiveZsh
|
||||
self.useSnapshotUpdate = state.useSnapshotUpdate
|
||||
self.sensitivity = 1 / state.mainWindowTemplate.trackpadScrollResistance
|
||||
self.useLiveResize = state.mainWindowTemplate.useLiveResize
|
||||
self.drawsParallel = state.mainWindowTemplate.drawsParallel
|
||||
|
||||
@ -66,13 +64,11 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
private var useSnapshotUpdate: Bool
|
||||
private var useLiveResize: Bool
|
||||
private var drawsParallel: Bool
|
||||
private var sensitivity: Double
|
||||
|
||||
private let useInteractiveZshCheckbox = NSButton(forAutoLayout: ())
|
||||
private let useSnapshotUpdateCheckbox = NSButton(forAutoLayout: ())
|
||||
private let useLiveResizeCheckbox = NSButton(forAutoLayout: ())
|
||||
private let drawsParallelCheckbox = NSButton(forAutoLayout: ())
|
||||
private let sensitivitySlider = NSSlider(forAutoLayout: ())
|
||||
|
||||
@available(*, unavailable)
|
||||
required init?(coder _: NSCoder) {
|
||||
@ -84,8 +80,6 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
self.useInteractiveZshCheckbox.boolState = self.useInteractiveZsh
|
||||
self.useLiveResizeCheckbox.boolState = self.useLiveResize
|
||||
self.drawsParallelCheckbox.boolState = self.drawsParallel
|
||||
|
||||
// We don't update the value of the NSSlider since we don't know when events are fired.
|
||||
}
|
||||
|
||||
private func addViews() {
|
||||
@ -142,29 +136,12 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
when scrolling very fast.
|
||||
"""#)
|
||||
|
||||
let sensitivityTitle = self.titleTextField(title: "Scroll Sensitivity:")
|
||||
let sensitivity = self.sensitivitySlider
|
||||
sensitivity.maxValue = 1 / 5.0
|
||||
sensitivity.minValue = 1 / 500
|
||||
sensitivity.target = self
|
||||
sensitivity.action = #selector(sensitivitySliderAction)
|
||||
let sensitivityInfo = self.infoTextField(markdown: #"""
|
||||
Trackpad scroll sensitivity is yet experimental. You may experience some issues.\
|
||||
If you do, please report them at [GitHub issue #572](https://github.com/qvacua/vimr/issues/572).
|
||||
"""#)
|
||||
|
||||
// We set the value of the NSSlider only at the beginning.
|
||||
self.sensitivitySlider.doubleValue = self.sensitivity
|
||||
|
||||
self.addSubview(paneTitle)
|
||||
|
||||
self.addSubview(useSnapshotUpdate)
|
||||
self.addSubview(useSnapshotUpdateInfo)
|
||||
self.addSubview(useInteractiveZsh)
|
||||
self.addSubview(useInteractiveZshInfo)
|
||||
self.addSubview(sensitivityTitle)
|
||||
self.addSubview(self.sensitivitySlider)
|
||||
self.addSubview(sensitivityInfo)
|
||||
self.addSubview(useLiveResize)
|
||||
self.addSubview(useLiveResizeInfo)
|
||||
self.addSubview(drawsParallelBox)
|
||||
@ -174,36 +151,26 @@ class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
|
||||
paneTitle.autoPinEdge(toSuperviewEdge: .left, withInset: 18)
|
||||
paneTitle.autoPinEdge(toSuperviewEdge: .right, withInset: 18, relation: .greaterThanOrEqual)
|
||||
|
||||
sensitivityTitle.autoPinEdge(.top, to: .bottom, of: paneTitle, withOffset: 18)
|
||||
sensitivityTitle.autoPinEdge(toSuperviewEdge: .left, withInset: 18)
|
||||
|
||||
sensitivity.autoSetDimension(.width, toSize: 150)
|
||||
sensitivity.autoAlignAxis(.baseline, toSameAxisOf: sensitivityTitle)
|
||||
sensitivity.autoPinEdge(.left, to: .right, of: sensitivityTitle, withOffset: 5)
|
||||
|
||||
sensitivityInfo.autoPinEdge(.top, to: .bottom, of: self.sensitivitySlider, withOffset: 5)
|
||||
sensitivityInfo.autoPinEdge(.left, to: .right, of: sensitivityTitle, withOffset: 5)
|
||||
|
||||
useLiveResize.autoPinEdge(.top, to: .bottom, of: sensitivityInfo, withOffset: 18)
|
||||
useLiveResize.autoPinEdge(.left, to: .right, of: sensitivityTitle, withOffset: 5)
|
||||
useLiveResize.autoPinEdge(.top, to: .bottom, of: paneTitle, withOffset: 18)
|
||||
useLiveResize.autoPinEdge(toSuperviewEdge: .left, withInset: 18)
|
||||
|
||||
useLiveResizeInfo.autoPinEdge(.top, to: .bottom, of: useLiveResize, withOffset: 5)
|
||||
useLiveResizeInfo.autoPinEdge(.left, to: .left, of: useLiveResize)
|
||||
|
||||
drawsParallelBox.autoPinEdge(.top, to: .bottom, of: useLiveResizeInfo, withOffset: 18)
|
||||
drawsParallelBox.autoPinEdge(.left, to: .right, of: sensitivityTitle, withOffset: 5)
|
||||
drawsParallelBox.autoPinEdge(.left, to: .left, of: useLiveResize, withOffset: 5)
|
||||
|
||||
drawsParallelInfo.autoPinEdge(.top, to: .bottom, of: drawsParallelBox, withOffset: 5)
|
||||
drawsParallelInfo.autoPinEdge(.left, to: .left, of: drawsParallelBox)
|
||||
|
||||
useSnapshotUpdate.autoPinEdge(.top, to: .bottom, of: drawsParallelInfo, withOffset: 18)
|
||||
useSnapshotUpdate.autoPinEdge(.left, to: .right, of: sensitivityTitle, withOffset: 5)
|
||||
useSnapshotUpdate.autoPinEdge(.left, to: .left, of: useLiveResize, withOffset: 5)
|
||||
|
||||
useSnapshotUpdateInfo.autoPinEdge(.top, to: .bottom, of: useSnapshotUpdate, withOffset: 5)
|
||||
useSnapshotUpdateInfo.autoPinEdge(.left, to: .left, of: useSnapshotUpdate)
|
||||
|
||||
useInteractiveZsh.autoPinEdge(.top, to: .bottom, of: useSnapshotUpdateInfo, withOffset: 18)
|
||||
useInteractiveZsh.autoPinEdge(.left, to: .right, of: sensitivityTitle, withOffset: 5)
|
||||
useInteractiveZsh.autoPinEdge(.left, to: .left, of: useLiveResize, withOffset: 5)
|
||||
|
||||
useInteractiveZshInfo.autoPinEdge(.top, to: .bottom, of: useInteractiveZsh, withOffset: 5)
|
||||
useInteractiveZshInfo.autoPinEdge(.left, to: .left, of: useInteractiveZsh)
|
||||
@ -221,10 +188,6 @@ extension AdvancedPref {
|
||||
self.emit(.setDrawsParallel(sender.boolState))
|
||||
}
|
||||
|
||||
@objc func sensitivitySliderAction(_ sender: NSSlider) {
|
||||
self.emit(.setTrackpadScrollResistance(1 / sender.doubleValue))
|
||||
}
|
||||
|
||||
@objc func useInteractiveZshAction(_ sender: NSButton) {
|
||||
self.emit(.setUseInteractiveZsh(sender.boolState))
|
||||
}
|
||||
|
@ -1224,7 +1224,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.39.0</string>
|
||||
<string>SNAPSHOT-20220419.180005</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@ -1241,7 +1241,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>20220416.182927</string>
|
||||
<string>20220419.180005</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.productivity</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
@ -209,9 +209,6 @@ class MainWindow: NSObject,
|
||||
|
||||
self.addViews(withTopInset: 0)
|
||||
|
||||
self.neoVimView.trackpadScrollResistance = CGFloat(
|
||||
state.trackpadScrollResistance
|
||||
)
|
||||
self.neoVimView.usesLiveResize = state.useLiveResize
|
||||
self.neoVimView.drawsParallel = self.drawsParallel
|
||||
self.neoVimView.delegate = self
|
||||
@ -449,14 +446,6 @@ class MainWindow: NSObject,
|
||||
self.neoVimView.isLeftOptionMeta = state.isLeftOptionMeta
|
||||
self.neoVimView.isRightOptionMeta = state.isRightOptionMeta
|
||||
|
||||
if self.neoVimView.trackpadScrollResistance
|
||||
!= state.trackpadScrollResistance
|
||||
{
|
||||
self.neoVimView.trackpadScrollResistance = CGFloat(
|
||||
state.trackpadScrollResistance
|
||||
)
|
||||
}
|
||||
|
||||
if self.neoVimView.usesLiveResize != state.useLiveResize {
|
||||
self.neoVimView.usesLiveResize = state.useLiveResize
|
||||
}
|
||||
|
@ -300,7 +300,6 @@ extension MainWindow {
|
||||
|
||||
var fileBrowserShowHidden = false
|
||||
|
||||
var trackpadScrollResistance = 5.0
|
||||
var useLiveResize = false
|
||||
var drawsParallel = false
|
||||
|
||||
@ -346,7 +345,6 @@ extension MainWindow {
|
||||
case isLeftOptionMeta = "is-left-option-meta"
|
||||
case isRightOptionMeta = "is-right-option-meta"
|
||||
|
||||
case trackpadScrollResistance = "trackpad-scroll-resistance"
|
||||
case useInteractiveZsh = "use-interactive-zsh"
|
||||
case useLiveResize = "use-live-resize"
|
||||
case drawsParallel = "draws-parallel"
|
||||
@ -372,11 +370,6 @@ extension MainWindow {
|
||||
forKey: .useInteractiveZsh,
|
||||
default: State.default.useInteractiveZsh
|
||||
)
|
||||
self.trackpadScrollResistance = try container.decode(
|
||||
forKey: .trackpadScrollResistance,
|
||||
default: State.default
|
||||
.trackpadScrollResistance
|
||||
)
|
||||
self.useLiveResize = try container.decode(
|
||||
forKey: .useLiveResize,
|
||||
default: State.default.useLiveResize
|
||||
@ -452,7 +445,6 @@ extension MainWindow {
|
||||
try container.encode(self.isAllToolsVisible, forKey: .allToolsVisible)
|
||||
try container.encode(self.isToolButtonsVisible, forKey: .toolButtonsVisible)
|
||||
try container.encode(NSStringFromRect(self.frame), forKey: .frame)
|
||||
try container.encode(self.trackpadScrollResistance, forKey: .trackpadScrollResistance)
|
||||
try container.encode(self.useLiveResize, forKey: .useLiveResize)
|
||||
try container.encode(self.drawsParallel, forKey: .drawsParallel)
|
||||
try container.encode(self.isLeftOptionMeta, forKey: .isLeftOptionMeta)
|
||||
|
@ -15,10 +15,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.39.0</string>
|
||||
<string>SNAPSHOT-20220419.180005</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>20220416.182927</string>
|
||||
<string>20220419.180005</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -6,24 +6,22 @@
|
||||
<description>Most recent changes with links to updates for VimR.</description>
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>v0.39.0-20220416.182927</title>
|
||||
<title>SNAPSHOT-20220419.180005</title>
|
||||
<link>https://twitter.com/vimrefined</link>
|
||||
<sparkle:version>20220416.182927</sparkle:version>
|
||||
<sparkle:shortVersionString>v0.39.0</sparkle:shortVersionString>
|
||||
<sparkle:version>20220419.180005</sparkle:version>
|
||||
<sparkle:shortVersionString>SNAPSHOT-20220419.180005</sparkle:shortVersionString>
|
||||
<description><![CDATA[
|
||||
<ul>
|
||||
<li>Neovim 0.7.0 😀</li>
|
||||
<li>GH-922: Add an option to set font smoothing.</li>
|
||||
<li>GH-928: Bugfix: Files containing some special characters in their names cannot be opened.</li>
|
||||
<li>Improved tracpad scrolling sensitivity (removed the option for customizing the sensitivity). Thanks @tsung-ju for the PR!</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
<releaseNotesLink>
|
||||
https://github.com/qvacua/vimr/releases/tag/v0.39.0-20220416.182927
|
||||
https://github.com/qvacua/vimr/releases/tag/snapshot/20220419.180005
|
||||
</releaseNotesLink>
|
||||
<pubDate>2022-04-16T18:43:41.274166</pubDate>
|
||||
<pubDate>2022-04-19T18:07:05.128691</pubDate>
|
||||
<minimumSystemVersion>10.13.0</minimumSystemVersion>
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.39.0-20220416.182927/VimR-v0.39.0.tar.bz2"
|
||||
sparkle:edSignature="Q5XobuaNiJUk8pFNsCwT+fUX4DnmHcKuWXosQj3imOb0UHY+EdWhyqgK0ERDQ51pSonerMZxJ0C+nolcCdXfBQ==" length="20982344"
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/20220419.180005/VimR-SNAPSHOT-20220419.180005.tar.bz2"
|
||||
sparkle:edSignature="MBXpZfvD/qaXWkqpFM8eeeTxXOnEcjiBGzRRJxpj88DepCbES/diPnNECk832A5TS0clt2j/iyzDq7nxFzzCCw==" length="20981009"
|
||||
type="application/octet-stream"/>
|
||||
</item>
|
||||
</channel>
|
||||
|
@ -1,3 +1,8 @@
|
||||
# Next
|
||||
|
||||
* Improved trackpad scrolling sensitivity (removed the option for customizing the sensitivity). Thanks @tsung-ju for the PR!
|
||||
* ...
|
||||
|
||||
# 0.39.0-20220416.182927
|
||||
|
||||
* Neovim 0.7.0 😀
|
||||
|
Loading…
Reference in New Issue
Block a user