mirror of
https://github.com/h3pdesign/Neon-Vision-Editor
synced 2026-04-21 21:37:17 +00:00
Fix scroll lock after large paste in editor
This commit is contained in:
parent
9e70954059
commit
d59a90aeeb
2 changed files with 13 additions and 0 deletions
|
|
@ -263,6 +263,7 @@
|
|||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||
AUTOMATION_APPLE_EVENTS = NO;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 105;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
|
|
@ -335,6 +336,7 @@
|
|||
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
|
||||
AUTOMATION_APPLE_EVENTS = NO;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 105;
|
||||
DEAD_CODE_STRIPPING = YES;
|
||||
|
|
|
|||
|
|
@ -39,10 +39,16 @@ final class AcceptingTextView: NSTextView {
|
|||
}
|
||||
|
||||
override func mouseDown(with event: NSEvent) {
|
||||
cancelPendingPasteCaretEnforcement()
|
||||
super.mouseDown(with: event)
|
||||
window?.makeFirstResponder(self)
|
||||
}
|
||||
|
||||
override func scrollWheel(with event: NSEvent) {
|
||||
cancelPendingPasteCaretEnforcement()
|
||||
super.scrollWheel(with: event)
|
||||
}
|
||||
|
||||
override func becomeFirstResponder() -> Bool {
|
||||
let didBecome = super.becomeFirstResponder()
|
||||
if didBecome, UserDefaults.standard.bool(forKey: vimModeDefaultsKey) {
|
||||
|
|
@ -517,6 +523,11 @@ final class AcceptingTextView: NSTextView {
|
|||
}
|
||||
}
|
||||
|
||||
private func cancelPendingPasteCaretEnforcement() {
|
||||
pendingPasteCaretLocation = nil
|
||||
NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(applyPendingPasteCaret), object: nil)
|
||||
}
|
||||
|
||||
@objc private func applyPendingPasteCaret() {
|
||||
guard let desired = pendingPasteCaretLocation else { return }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue