1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-09-11 17:15:34 +03:00

Compare commits

...

41 Commits

Author SHA1 Message Date
Tae Won Ha
8d953fa0a0
Xcode shenanigans 2024-05-31 22:35:30 +09:00
Tae Won Ha
e22bd2d755
Xcode shenanigans 2024-05-31 22:33:32 +09:00
Tae Won Ha
fd63e8dace
Update appcast 2024-05-31 22:25:28 +09:00
Tae Won Ha
5aa941e6cb
Bump version to v0.47.2-20240531.221846 2024-05-31 22:18:46 +09:00
Tae Won Ha
ab3efd4a44
Update appcast 2024-05-31 22:16:51 +09:00
Tae Won Ha
79862b02e5
Bump version to snapshot/20240531.221229 2024-05-31 22:12:30 +09:00
Tae Won Ha
dc99ead2ef
Adapt API generation script 2024-05-31 22:11:23 +09:00
Tae Won Ha
aabd13c6ef
swiftformat 2024-05-31 17:12:54 +09:00
Tae Won Ha
36a18ed474
Always use live resizing 2024-05-31 17:11:37 +09:00
Tae Won Ha
071369cdc3
Make live resizing default behavior 2024-05-31 16:49:53 +09:00
Tae Won Ha
fd842a2500
Fix and adapt API generation
- Do not remove the `nvim_` prefix
2024-05-31 13:06:01 +09:00
Tae Won Ha
80fb7e3ba9
Update deps 2024-05-30 12:59:42 +09:00
Tae Won Ha
f3bc562276
Archive artifacts even if the job is not successful 2024-05-30 11:06:54 +09:00
Tae Won Ha
bdcde67821
Update readme and develop 2024-05-30 11:04:26 +09:00
Tae Won Ha
601f2b151b
Update DEVELOP.md 2024-05-29 15:22:48 +09:00
Tae Won Ha
3731fd8119
Record-only merge branch 'update-neovim' 2024-05-28 17:40:41 +09:00
Tae Won Ha
bbfaad2f57
Update DEVELOP.md 2024-05-28 17:31:47 +09:00
Tae Won Ha
b9b524679a
Update appcast 2024-05-28 17:19:48 +09:00
Tae Won Ha
6290e6fe00
Bump version to v0.47.1-20240528.171603 2024-05-28 17:16:03 +09:00
Tae Won Ha
a4be54cc49
Generate API 2024-05-28 17:13:50 +09:00
Tae Won Ha
564defb63e
Update neovim 2024-03-02 14:23:49 +01:00
Tae Won Ha
e29ce4dd56
Update develop.md 2024-01-25 20:41:12 +01:00
Tae Won Ha
3fb8aef760
Build gettext when building neovim 2024-01-25 20:41:12 +01:00
Tae Won Ha
b4923c163a
Update neovim 2024-01-25 20:39:56 +01:00
Tae Won Ha
c920dafae8
Update neovim 2024-01-16 17:48:45 +01:00
Tae Won Ha
df1faaaf57
Merge branch 'master' into update-neovim 2024-01-16 17:48:20 +01:00
Tae Won Ha
97befa52c9
Update neovim 2024-01-13 21:14:34 +01:00
Tae Won Ha
f4ef53082c
Merge branch 'master' into update-neovim 2024-01-13 21:14:18 +01:00
Tae Won Ha
93c54bc682
Generate sources 2024-01-08 20:12:33 +01:00
Tae Won Ha
f30cecb624
Merge branch 'master' into update-neovim
Conflicts:
	Neovim
2024-01-08 20:09:00 +01:00
Tae Won Ha
b0356efb08
Replace when uploading 2023-12-23 21:47:00 +01:00
Tae Won Ha
fe3197986b
Merge branch 'master' into update-neovim
Conflicts:
	RxPack/Sources/RxNeovim/RxNeovimApi.generated.swift
2023-12-23 21:37:50 +01:00
Tae Won Ha
9a0b7435ec
Update neovim 2023-12-23 21:35:30 +01:00
Tae Won Ha
c7754c7ed6
Merge branch 'master' into update-neovim 2023-12-17 21:48:43 +01:00
Tae Won Ha
b94adc6cf1
Merge branch 'master' into update-neovim 2023-12-17 21:39:12 +01:00
Tae Won Ha
13460018af
Merge branch 'master' into update-neovim 2023-12-17 21:33:25 +01:00
Tae Won Ha
5dc9684836
Merge branch 'master' into update-neovim 2023-12-17 21:31:54 +01:00
Tae Won Ha
e1473abac5
Generate API methods 2023-12-17 21:11:37 +01:00
Tae Won Ha
2c0ed9125e
Update neovim 2023-12-17 21:08:45 +01:00
Tae Won Ha
fd3635c99e
Merge branch 'master' into update-neovim 2023-12-17 21:08:29 +01:00
Tae Won Ha
538aa62ee7
Update Neovim to master 2023-12-11 21:56:19 +01:00
44 changed files with 1571 additions and 1723 deletions

View File

@ -1,25 +1,26 @@
## How to develop
In most cases, you can use the pre-built universal Neovim build by running
VimR includes a stock Neovim. From Neovim `v0.10.0`, we provide pre-built universal Neovim,
see for instance <https://github.com/qvacua/vimr/releases/tag/neovim-v0.10.0-20240527.232810>.
In most cases, you can use the pre-built Neovim.
Run the following
```bash
clean=true for_dev=false ./bin/build_nvimserver.sh
```
If you want to build Neovim locally, i.e., no universal build, you can use
to download and place the files in the appropriate places.
Now, you can just *run* VimR target in Xcode.
If you want to build Neovim locally, you can use
```bash
clean=true for_dev=true ./bin/build_nvimserver.sh
```
This is used when generating source since we need some generated header files.
Afterwards, you can run VimR target in Xcode.
### Generating sources when upgrading Neovim
```bash
clean=true ./RxPack/bin/generate_sources.sh # generate API methods
clean=false for_dev=true ./bin/build_nvimserver.sh # generate auto commands and cursor modes
```
(This is used when generating source since we need some generated header files.)
### How to enable the Debug menu in Release build
@ -31,7 +32,11 @@ defaults write com.qvacua.VimR enable-debug-menu 1
### Neovim
* Update Neovim and generate sources.
* Update Neovim and generate sources:
```bash
clean=true use_committed_nvim=true ./bin/generate_sources.sh
```
Use `use_committed=false` if you want to use modified local Neovim submodule.
* Commit and push.
* Tag and push with the following
```bash

View File

@ -70,7 +70,7 @@ final class AttributesRunDrawer {
context.setFillColor(ColorUtils.cgColorIgnoringAlpha(run.attrs.effectiveForeground))
fontGlyphRuns.forEach { run in
for run in fontGlyphRuns {
CTFontDrawGlyphs(run.font, run.glyphs, run.positions, run.glyphs.count, context)
}
@ -189,7 +189,7 @@ final class AttributesRunDrawer {
self.descent = CTFontGetDescent(self.font)
self.underlinePosition = CTFontGetUnderlinePosition(self.font)
self.underlineThickness = CTFontGetUnderlineThickness(self.font)
self.typesetter.clearCache()
}
}

View File

@ -34,12 +34,12 @@ public extension NvimView {
}
func isBlocked() -> Single<Bool> {
self.api.getMode().map { dict in dict["blocking"]?.boolValue ?? false }
self.api.nvimGetMode().map { dict in dict["blocking"]?.boolValue ?? false }
}
func hasDirtyBuffers() -> Single<Bool> {
self.api
.execLua(code: """
.nvimExecLua(code: """
return vim.fn.getbufinfo({"bufmodified": v:true})
""", args: [])
.map { result -> Bool in
@ -67,7 +67,7 @@ public extension NvimView {
func currentBuffer() -> Single<NvimView.Buffer> {
self.api
.getCurrentBuf()
.nvimGetCurrentBuf()
.flatMap { [weak self] in
guard let single = self?.neoVimBuffer(for: $0, currentBuffer: $0) else {
throw RxNeovimApi.Error.exception(message: "Could not get buffer")
@ -79,7 +79,7 @@ public extension NvimView {
func allBuffers() -> Single<[NvimView.Buffer]> {
Single
.zip(self.api.getCurrentBuf(), self.api.listBufs()) { (curBuf: $0, bufs: $1) }
.zip(self.api.nvimGetCurrentBuf(), self.api.nvimListBufs()) { (curBuf: $0, bufs: $1) }
.map { [weak self] tuple in
tuple.bufs.compactMap { buf in
self?.neoVimBuffer(for: buf, currentBuffer: tuple.curBuf)
@ -98,9 +98,9 @@ public extension NvimView {
func allTabs() -> Single<[NvimView.Tabpage]> {
Single.zip(
self.api.getCurrentBuf(),
self.api.getCurrentTabpage(),
self.api.listTabpages()
self.api.nvimGetCurrentBuf(),
self.api.nvimGetCurrentTabpage(),
self.api.nvimListTabpages()
) { (curBuf: $0, curTab: $1, tabs: $2) }
.map { [weak self] tuple in
tuple.tabs.compactMap { tab in
@ -113,7 +113,7 @@ public extension NvimView {
func newTab() -> Completable {
self.api
.command(command: "tabe")
.nvimCommand(command: "tabe")
.subscribe(on: self.scheduler)
}
@ -129,7 +129,7 @@ public extension NvimView {
let bufExists = buffers.contains { $0.url == url }
let wins = tabs.map(\.windows).flatMap { $0 }
if let win = bufExists ? wins.first(where: { win in win.buffer.url == url }) : nil {
return self?.api.setCurrentWin(window: RxNeovimApi.Window(win.handle))
return self?.api.nvimSetCurrentWin(window: RxNeovimApi.Window(win.handle))
}
return currentBufferIsTransient ? self?.open(url, cmd: "e") : self?
@ -168,7 +168,8 @@ public extension NvimView {
.map { tabs in tabs.map(\.windows).flatMap { $0 } }
.flatMapCompletable { [weak self] wins -> Completable in
if let win = wins.first(where: { $0.buffer == buffer }) {
guard let completable = self?.api.setCurrentWin(window: RxNeovimApi.Window(win.handle))
guard let completable = self?.api
.nvimSetCurrentWin(window: RxNeovimApi.Window(win.handle))
else {
throw RxNeovimApi.Error.exception(message: "Could not set current win")
}
@ -176,7 +177,7 @@ public extension NvimView {
return completable
}
guard let completable = self?.api.command(command: "tab sb \(buffer.handle)") else {
guard let completable = self?.api.nvimCommand(command: "tab sb \(buffer.handle)") else {
throw RxNeovimApi.Error.exception(message: "Could tab sb")
}
return completable
@ -186,44 +187,44 @@ public extension NvimView {
func goTo(line: Int) -> Completable {
self.api
.command(command: "\(line)")
.nvimCommand(command: "\(line)")
.subscribe(on: self.scheduler)
}
/// Closes the current window.
func closeCurrentTab() -> Completable {
self.api
.command(command: "q")
.nvimCommand(command: "q")
.subscribe(on: self.scheduler)
}
func saveCurrentTab() -> Completable {
self.api
.command(command: "w")
.nvimCommand(command: "w")
.subscribe(on: self.scheduler)
}
func saveCurrentTab(url: URL) -> Completable {
self.api
.command(command: "w \(url.shellEscapedPath)")
.nvimCommand(command: "w \(url.shellEscapedPath)")
.subscribe(on: self.scheduler)
}
func closeCurrentTabWithoutSaving() -> Completable {
self.api
.command(command: "q!")
.nvimCommand(command: "q!")
.subscribe(on: self.scheduler)
}
func quitNeoVimWithoutSaving() -> Completable {
self.api
.command(command: "qa!")
.nvimCommand(command: "qa!")
.subscribe(on: self.scheduler)
}
func vimOutput(of command: String) -> Single<String> {
self.api
.exec2(src: command, opts: ["output": true])
.nvimExec2(src: command, opts: ["output": true])
.map {
retval in
guard let output_value = retval["output"] ?? retval["output"],
@ -236,9 +237,9 @@ public extension NvimView {
func cursorGo(to position: Position) -> Completable {
self.api
.getCurrentWin()
.nvimGetCurrentWin()
.flatMapCompletable { [weak self] curWin in
guard let completable = self?.api.winSetCursor(
guard let completable = self?.api.nvimWinSetCursor(
window: curWin,
pos: [position.row, position.column]
) else {
@ -262,7 +263,7 @@ public extension NvimView {
for buf: RxNeovimApi.Buffer,
currentBuffer: RxNeovimApi.Buffer?
) -> Single<NvimView.Buffer> {
self.api.execLua(code: """
self.api.nvimExecLua(code: """
local function map(tbl, f)
local t = {}
for k,v in pairs(tbl) do
@ -316,7 +317,7 @@ public extension NvimView {
private func open(_ url: URL, cmd: String) -> Completable {
self.api
.command(command: "\(cmd) \(url.shellEscapedPath)")
.nvimCommand(command: "\(cmd) \(url.shellEscapedPath)")
.subscribe(on: self.scheduler)
}
@ -326,7 +327,7 @@ public extension NvimView {
currentBuffer: RxNeovimApi.Buffer?
) -> Single<NvimView.Window> {
self.api
.winGetBuf(window: window)
.nvimWinGetBuf(window: window)
.flatMap { [weak self] buf in
guard let single = self?.neoVimBuffer(for: buf, currentBuffer: currentBuffer) else {
throw RxNeovimApi.Error.exception(message: "Could not get buffer")
@ -348,8 +349,8 @@ public extension NvimView {
currentBuffer: RxNeovimApi.Buffer?
) -> Single<NvimView.Tabpage> {
Single.zip(
self.api.tabpageGetWin(tabpage: tabpage),
self.api.tabpageListWins(tabpage: tabpage)
self.api.nvimTabpageGetWin(tabpage: tabpage),
self.api.nvimTabpageListWins(tabpage: tabpage)
) { (curWin: $0, wins: $1) }
.map { [weak self] tuple in
tuple.wins.compactMap { win in

View File

@ -8,18 +8,13 @@ import Cocoa
extension NvimView {
override public func viewDidMoveToWindow() { self.window?.colorSpace = colorSpace }
override public func draw(_ dirtyUnionRect: NSRect) {
override public func draw(_: NSRect) {
guard self.ugrid.hasData else { return }
guard let context = NSGraphicsContext.current?.cgContext else { return }
context.saveGState()
defer { context.restoreGState() }
if self.inLiveResize || self.currentlyResizing, !self.usesLiveResize {
self.drawResizeInfo(in: context, with: dirtyUnionRect)
return
}
if self.isCurrentlyPinching {
self.drawPinchImage(in: context)
return

View File

@ -43,7 +43,7 @@ public extension NvimView {
let finalInput = isWrapNeeded ? self.wrapNamedKeys(flags + namedChars)
: self.vimPlainString(chars)
_ = self.api.input(keys: finalInput, errWhenBlocked: false).syncValue()
_ = self.api.nvimInput(keys: finalInput, errWhenBlocked: false).syncValue()
self.keyDownDone = true
}
@ -60,7 +60,7 @@ public extension NvimView {
// try? self.api.feedkeys(keys: self.vimPlainString(text), mode:"m", escape_ks: false)
// .wait()
_ = self.api.input(keys: self.vimPlainString(text), errWhenBlocked: false).syncValue()
_ = self.api.nvimInput(keys: self.vimPlainString(text), errWhenBlocked: false).syncValue()
if self.hasMarkedText() { self._unmarkText() }
self.keyDownDone = true
@ -125,7 +125,7 @@ public extension NvimView {
// So we escape as early as possible
if chars == "\0" {
self.api
.input(keys: self.wrapNamedKeys("Nul"), errWhenBlocked: false)
.nvimInput(keys: self.wrapNamedKeys("Nul"), errWhenBlocked: false)
.subscribe(onFailure: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})
@ -138,7 +138,7 @@ public extension NvimView {
// Also mentioned in MacVim's KeyBindings.plist
if flags == .control, chars == "6" {
self.api
.input(keys: "\u{1e}", errWhenBlocked: false) // AKA ^^
.nvimInput(keys: "\u{1e}", errWhenBlocked: false) // AKA ^^
.subscribe(onFailure: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})
@ -149,7 +149,7 @@ public extension NvimView {
if flags == .control, chars == "2" {
// <C-2> should generate \0, escaping as above
self.api
.input(keys: self.wrapNamedKeys("Nul"), errWhenBlocked: false)
.nvimInput(keys: self.wrapNamedKeys("Nul"), errWhenBlocked: false)
.subscribe(onFailure: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})
@ -183,7 +183,7 @@ public extension NvimView {
}
if replacementRange.length > 0 {
let text = String(repeating: "<BS>", count: replacementRange.length)
try? self.api.feedkeys(keys: text, mode: "i", escape_ks: false)
try? self.api.nvimFeedkeys(keys: text, mode: "i", escape_ks: false)
.wait()
}

View File

@ -42,14 +42,14 @@ extension NvimView {
switch self.mode {
case .insert, .replace:
self.api
.input(keys: "<Esc>ui")
.nvimInput(keys: "<Esc>ui")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not undo", cause: error))
})
.disposed(by: self.disposeBag)
case .normal, .visual:
self.api
.input(keys: "u")
.nvimInput(keys: "u")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not undo", cause: error))
})
@ -63,14 +63,14 @@ extension NvimView {
switch self.mode {
case .insert, .replace:
self.api
.input(keys: "<Esc><C-r>i")
.nvimInput(keys: "<Esc><C-r>i")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not redo", cause: error))
})
.disposed(by: self.disposeBag)
case .normal, .visual:
self.api
.input(keys: "<C-r>")
.nvimInput(keys: "<C-r>")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not redo", cause: error))
})
@ -84,7 +84,7 @@ extension NvimView {
switch self.mode {
case .visual, .normal:
self.api
.input(keys: "\"+d")
.nvimInput(keys: "\"+d")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not cut", cause: error))
})
@ -98,7 +98,7 @@ extension NvimView {
switch self.mode {
case .visual, .normal:
self.api
.input(keys: "\"+y")
.nvimInput(keys: "\"+y")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not copy", cause: error))
})
@ -113,7 +113,7 @@ extension NvimView {
// phase == 1 means paste in a single call
self.api
.paste(data: content, crlf: false, phase: -1)
.nvimPaste(data: content, crlf: false, phase: -1)
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not paste \(content)", cause: error))
})
@ -124,7 +124,7 @@ extension NvimView {
switch self.mode {
case .normal, .visual:
self.api
.input(keys: "x")
.nvimInput(keys: "x")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not delete", cause: error))
})
@ -138,14 +138,14 @@ extension NvimView {
switch self.mode {
case .insert, .visual:
self.api
.input(keys: "<Esc>ggVG")
.nvimInput(keys: "<Esc>ggVG")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not select all", cause: error))
})
.disposed(by: self.disposeBag)
default:
self.api
.input(keys: "ggVG")
.nvimInput(keys: "ggVG")
.subscribe(onFailure: { [weak self] error in
self?.eventsSubject.onNext(.apiError(msg: "Could not select all", cause: error))
})

View File

@ -59,8 +59,8 @@ public extension NvimView {
cellPosition: cellPosition
)
self.api
.input(keys: vimInputX).asCompletable()
.andThen(self.api.input(keys: vimInputY).asCompletable())
.nvimInput(keys: vimInputX).asCompletable()
.andThen(self.api.nvimInput(keys: vimInputY).asCompletable())
.subscribe(onError: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})
@ -94,13 +94,13 @@ public extension NvimView {
"# scroll: \(cellPosition.row + vertSign * absDeltaY) \(cellPosition.column + horizSign * absDeltaX)"
)
self.api.winGetCursor(window: RxNeovimApi.Window(0))
self.api.nvimWinGetCursor(window: RxNeovimApi.Window(0))
.flatMapCompletable { cursor in
guard cursor.count == 2 else {
self.log.error("Error decoding \(cursor)")
return Completable.empty()
}
return self.api.winSetCursor(
return self.api.nvimWinSetCursor(
window: RxNeovimApi.Window(0),
pos: [cursor[0] + vertSign * absDeltaY, cursor[1] + horizSign * absDeltaX]
)
@ -169,7 +169,7 @@ public extension NvimView {
}
self.api
.input(keys: result)
.nvimInput(keys: result)
.subscribe(onFailure: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})

View File

@ -56,14 +56,14 @@ extension NvimView {
final func signalRemoteOptionChange(_ option: RemoteOption) {
let command: Completable = switch option {
case let .guifont(fontSpec):
self.api.setOptionValue(
self.api.nvimSetOptionValue(
name: "guifont",
value: .string(fontSpec),
opts: ["scope": .string("global")]
)
case let .guifontWide(fontSpec):
self.api.setOptionValue(
self.api.nvimSetOptionValue(
name: "guifontwide",
value: .string(fontSpec),
opts: ["scope": .string("global")]
@ -80,7 +80,7 @@ extension NvimView {
}
public final func signalError(code: Int, message: String) {
self.api.errWriteln(str: "E\(code): \(message)")
self.api.nvimErrWriteln(str: "E\(code): \(message)")
.subscribe()
.disposed(by: self.disposeBag)
}

View File

@ -22,16 +22,6 @@ extension NvimView {
return
}
if self.usesLiveResize {
self.resizeNeoVimUi(to: newSize)
return
}
if self.inLiveResize || self.currentlyResizing { return }
// There can be cases where the frame is resized not by live resizing,
// eg when the window is resized by window management tools.
// Thus, we make sure that the resize call is made when this happens.
self.resizeNeoVimUi(to: newSize)
}
@ -59,7 +49,7 @@ extension NvimView {
self.offset.x = floor((size.width - self.cellSize.width * discreteSize.width.cgf) / 2)
self.offset.y = floor((size.height - self.cellSize.height * discreteSize.height.cgf) / 2)
self.api.uiTryResize(width: discreteSize.width, height: discreteSize.height)
self.api.nvimUiTryResize(width: discreteSize.width, height: discreteSize.height)
.subscribe(onError: { [weak self] error in
self?.log.error("Error in \(#function): \(error)")
})
@ -99,7 +89,7 @@ extension NvimView {
// NvimView.swift
try? self.api.run(inPipe: inPipe, outPipe: outPipe, errorPipe: errorPipe)
.andThen(
self.api.getApiInfo(errWhenBlocked: false)
self.api.nvimGetApiInfo(errWhenBlocked: false)
.flatMapCompletable { value in
guard let info = value.arrayValue,
info.count == 2,
@ -122,7 +112,7 @@ extension NvimView {
}
// swiftformat:disable all
return self.api.exec2(src: """
return self.api.nvimExec2(src: """
let g:gui_vimr = 1
autocmd VimLeave * call rpcnotify(\(channel), 'autocommand', 'vimleave')
autocmd VimEnter * call rpcnotify(\(channel), 'autocommand', 'vimenter')
@ -134,7 +124,7 @@ extension NvimView {
}
)
.andThen(
self.api.uiAttach(width: size.width, height: size.height, options: [
self.api.nvimUiAttach(width: size.width, height: size.height, options: [
"ext_linegrid": true,
"ext_multigrid": false,
"ext_tabline": MessagePackValue(self.usesCustomTabBar),

View File

@ -121,7 +121,7 @@ extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate
let window = tab.currentWindow ?? tab.windows[0]
self.api
.setCurrentWin(window: RxNeovimApi.Window(window.handle))
.nvimSetCurrentWin(window: RxNeovimApi.Window(window.handle))
.subscribe(on: self.scheduler)
.subscribe(onError: { [weak self] error in
self?.eventsSubject

View File

@ -101,10 +101,10 @@ public extension NvimView {
public var visualBackground = NSColor.selectedContentBackgroundColor
public var directoryForeground = NSColor.textColor
public var tabForeground = NSColor.textColor
public var tabBackground = NSColor.textBackgroundColor
public init() {}
public init(_ values: [Int]) {
@ -121,8 +121,8 @@ public extension NvimView {
self.directoryForeground = values[4] < 0
? Theme.default.directoryForeground
: color(values[4])
self.tabBackground = values[5] < 0 ? Theme.default.background : color(values[5])
self.tabForeground = values[6] < 0 ? Theme.default.foreground : color(values[6])
self.tabBackground = values[5] < 0 ? Theme.default.background : color(values[5])
self.tabForeground = values[6] < 0 ? Theme.default.foreground : color(values[6])
}
public var description: String {

View File

@ -360,7 +360,9 @@ extension NvimView {
}
private func flush() {
for region in self.regionsToFlush { self.markForRender(region: region) }
for region in self.regionsToFlush {
self.markForRender(region: region)
}
self.regionsToFlush.removeAll(keepingCapacity: true)
}
@ -730,7 +732,7 @@ extension NvimView {
}
func focusGained(_ gained: Bool) -> Completable {
self.api.uiSetFocus(gained: gained)
self.api.nvimUiSetFocus(gained: gained)
}
private func quit() -> Completable {

View File

@ -70,8 +70,6 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
public internal(set) var theme = Theme.default
public var usesLiveResize = false
public var usesLigatures = false {
didSet {
self.drawer.usesLigatures = self.usesLigatures
@ -128,7 +126,7 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
set {
self.api
.setCurrentDir(dir: newValue.path)
.nvimSetCurrentDir(dir: newValue.path)
.subscribe(on: self.scheduler)
.subscribe(onError: { [weak self] error in
self?.eventsSubject
@ -229,13 +227,13 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
let db = self.disposeBag
self.tabBar?.closeHandler = { [weak self] index, _, _ in
self?.api
.command(command: "tabclose \(index + 1)")
.nvimCommand(command: "tabclose \(index + 1)")
.subscribe()
.disposed(by: db)
}
self.tabBar?.selectHandler = { [weak self] _, tabEntry, _ in
self?.api
.setCurrentTabpage(tabpage: tabEntry.tabpage)
.nvimSetCurrentTabpage(tabpage: tabEntry.tabpage)
.subscribe()
.disposed(by: db)
}
@ -243,7 +241,7 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
// I don't know why, but `tabm ${last_index}` does not always work.
let command = (index == entries.count - 1) ? "tabm" : "tabm \(index)"
self?.api
.command(command: command)
.nvimCommand(command: command)
.subscribe()
.disposed(by: db)
}
@ -350,7 +348,7 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
private var _characterspacing = NvimView.defaultCharacterspacing
private func doSetupForVimenterAndSendResponse(forMsgid msgid: UInt32) {
self.api.getApiInfo(errWhenBlocked: false)
self.api.nvimGetApiInfo(errWhenBlocked: false)
.flatMapCompletable { value in
guard let info = value.arrayValue,
info.count == 2,
@ -360,7 +358,7 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
}
// swiftformat:disable all
return self.api.exec2(src: """
return self.api.nvimExec2(src: """
autocmd BufWinEnter * call rpcnotify(\(channel), 'autocommand', 'bufwinenter', str2nr(expand('<abuf>')))
autocmd BufWinLeave * call rpcnotify(\(channel), 'autocommand', 'bufwinleave', str2nr(expand('<abuf>')))
autocmd TabEnter * call rpcnotify(\(channel), 'autocommand', 'tabenter', str2nr(expand('<abuf>')))
@ -371,11 +369,11 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
""", opts: [:], errWhenBlocked: false)
// swiftformat:enable all
.asCompletable()
.andThen(self.api.subscribe(event: NvimView.rpcEventName, expectsReturnValue: false))
.andThen(self.api.nvimSubscribe(event: NvimView.rpcEventName, expectsReturnValue: false))
.andThen(
self.sourceFileUrls.reduce(.empty()) { prev, url in
prev.andThen(
self.api.exec2(
self.api.nvimExec2(
src: "source \(url.shellEscapedPath)",
opts: ["output": true],
errWhenBlocked: false
@ -399,7 +397,7 @@ public final class NvimView: NSView, NSUserInterfaceValidations, NSTextInputClie
guard FileManager.default.fileExists(atPath: ginitPath) else { return .empty() }
self.bridgeLogger.debug("Source'ing ginit.vim")
return self.api.command(command: "source \(ginitPath.shellEscapedPath)")
return self.api.nvimCommand(command: "source \(ginitPath.shellEscapedPath)")
}()
)
}

View File

@ -11,7 +11,7 @@ final class Typesetter {
func clearCache() {
self.ctRunsCache.clear()
}
func fontGlyphRunsWithLigatures(
nvimUtf16Cells: [[Unicode.UTF16.CodeUnit]],
startColumn: Int,
@ -264,7 +264,9 @@ final class Typesetter {
let element = pointer[k]
if element.isEmpty { continue }
for j in 0..<element.count { resultPtr[i + j] = element[j] }
for j in 0..<element.count {
resultPtr[i + j] = element[j]
}
i = i + element.count
}

View File

@ -7,11 +7,10 @@
## About
Project VimR is a Neovim GUI for macOS written in Swift.
VimR is a Neovim GUI for macOS written in Swift.
The goal is to build an editor that uses Neovim inside with many of the convenience
GUI features similar to those present in modern editors. We mainly use Swift,
but also use C/Objective-C when where appropriate.
The goal is to build an editor that uses Neovim inside with some of the convenience
GUI features similar to those present in modern editors.
There are other Neovim GUIs for macOS, see the [list](https://github.com/neovim/neovim/wiki/Related-projects#gui), so why?
@ -30,9 +29,11 @@ Pre-built Universal signed and notarized binaries can be found under [Releases](
## Reusable Components
* [RxMsgpackRpc](https://github.com/qvacua/vimr/blob/develop/RxPack/RxMsgpackRpc.swift): Implementation of MsgpackRpc using RxSwift.
* [RxNeovimApi](https://github.com/qvacua/vimr/blob/develop/RxPack/RxNeovimApi.swift): RxSwift wrapper of Neovim API.
* [NvimView](https://github.com/qvacua/vimr/tree/develop/NvimView): SwiftPM module containing an NSView which bundles everything, e.g., Neovim binary and its `runtime`-files, needed to embed Neovim in a Cocoa App.
* [NvimView](https://github.com/qvacua/vimr/tree/master/NvimView): SwiftPM module containing
an NSView which bundles everything, e.g., Neovim binary and its `runtime`-files, needed to
embed Neovim in a Cocoa App.
* [RxMsgpackRpc](https://github.com/qvacua/vimr/tree/master/RxPack/Sources/RxPack/RxMsgpackRpc.swift): Implementation of MsgpackRpc using RxSwift.
* [RxNeovimApi](https://github.com/qvacua/vimr/tree/master/RxPack/Sources/RxNeovim): RxSwift wrapper of Neovim API.
## Some Features
@ -50,12 +51,10 @@ Pre-built Universal signed and notarized binaries can be found under [Releases](
Clone this repository. Install `homebrew`, then in the project root:
```bash
git submodule init
git submodule update
git submodule update --init
xcode-select --install # install the Xcode command line tools, if you haven't already
brew bundle
brew bundle # install dependencies, e.g., build tools for Neovim
clean=true notarize=false ./bin/build_vimr.sh
# VimR.app will be placed in ./build/Build/Products/Release/
```

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ public final class RxNeovimApi {
public func checkBlocked<T>(_ single: Single<T>) -> Single<T> {
self
.getMode()
.nvimGetMode()
.flatMap { dict -> Single<T> in
guard (dict["blocking"]?.boolValue ?? false) == false else {
throw RxNeovimApi.Error.blocked

View File

@ -370,10 +370,12 @@ def parse_params(raw_params):
def parse_function(f):
args = parse_args(f['parameters'])
template = void_func_template if f['return_type'] == 'void' else func_template
template = get_mode_func_template if f['name'] == 'nvim_get_mode' else template
nvim_func_name = f['name']
template = get_mode_func_template if nvim_func_name == 'nvim_get_mode' else template
result = template.substitute(
func_name=snake_to_camel(f['name'][5:]),
nvim_func_name=f['name'],
func_name=snake_to_camel(nvim_func_name),
nvim_func_name=nvim_func_name,
args=args,
params=parse_params(f['parameters']),
result_type=nvim_type_to_swift(f['return_type']),
@ -414,10 +416,10 @@ if __name__ == '__main__':
nvim_path = os.environ['NVIM_PATH'] if 'NVIM_PATH' in os.environ else 'nvim'
nvim_output = subprocess.run([nvim_path, '--api-info'], stdout=subprocess.PIPE)
api = msgpack.unpackb(nvim_output.stdout)
api = msgpack.unpackb(nvim_output.stdout, raw=False)
version = parse_version(api['version'])
functions = api['functions'] #[f for f in api['functions'] if 'deprecated_since' not in f]
functions = api['functions']
body = '\n'.join([parse_function(f) for f in functions])
result = extension_template.substitute(

View File

@ -4,7 +4,7 @@ set -Eeuo pipefail
readonly clean=${clean:?"true or false"}
build_nvimserver_bin() {
./bin/neovim/bin/build_neovim.sh
./bin/neovim/bin/build_neovim_for_dev.sh
}
main() {

View File

@ -18,6 +18,33 @@
"version" : "2.2.1"
}
},
{
"identity" : "dictionarycoding",
"kind" : "remoteSourceControl",
"location" : "https://github.com/elegantchaos/DictionaryCoding",
"state" : {
"revision" : "ae19e456bd550fed8f341e5bae4318333c53a5b4",
"version" : "1.0.9"
}
},
{
"identity" : "down",
"kind" : "remoteSourceControl",
"location" : "https://github.com/johnxnguyen/Down",
"state" : {
"revision" : "f34b166be1f1db4aa8f573067e901d72f2a6be57",
"version" : "0.11.0"
}
},
{
"identity" : "fsevents",
"kind" : "remoteSourceControl",
"location" : "https://github.com/qvacua/FSEvents",
"state" : {
"branch" : "release-fseventstream",
"revision" : "90ed674df15b5e546a061052dad70228b3300fba"
}
},
{
"identity" : "material-icons",
"kind" : "remoteSourceControl",
@ -68,8 +95,44 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveX/RxSwift",
"state" : {
"revision" : "9dcaa4b333db437b0fbfaf453fad29069044a8b4",
"version" : "6.6.0"
"revision" : "b06a8c8596e4c3e8e7788e08e720e3248563ce6a",
"version" : "6.7.1"
}
},
{
"identity" : "shortcutrecorder",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Kentzo/ShortcutRecorder",
"state" : {
"revision" : "c86ce0f9be5353ba998966121c7631602a9a36f7",
"version" : "3.4.0"
}
},
{
"identity" : "sparkle",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
"revision" : "41847a58cdef7506b257591fcca6f9495df591d4",
"version" : "2.6.2"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
}
},
{
"identity" : "swifter",
"kind" : "remoteSourceControl",
"location" : "https://github.com/httpswift/swifter",
"state" : {
"revision" : "9483a5d459b45c3ffd059f7b55f9638e268632fd",
"version" : "1.5.0"
}
}
],

View File

@ -1126,7 +1126,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20240528.165939;
CURRENT_PROJECT_VERSION = 20240531.221846;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_MODULE_VERIFIER = YES;
@ -1192,7 +1192,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 20240528.165939;
CURRENT_PROJECT_VERSION = 20240531.221846;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_MODULE_VERIFIER = YES;
@ -1225,7 +1225,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20240528.165939;
CURRENT_PROJECT_VERSION = 20240531.221846;
DEFINES_MODULE = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
IBC_MODULE = VimR;
@ -1250,7 +1250,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 20240528.165939;
CURRENT_PROJECT_VERSION = 20240531.221846;
DEFINES_MODULE = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
IBC_MODULE = VimR;
@ -1361,7 +1361,7 @@
repositoryURL = "https://github.com/ReactiveX/RxSwift";
requirement = {
kind = exactVersion;
version = 6.6.0;
version = 6.7.1;
};
};
4B9BC42824EB2E6D000209B5 /* XCRemoteSwiftPackageReference "ShortcutRecorder" */ = {
@ -1393,7 +1393,7 @@
repositoryURL = "https://github.com/sparkle-project/Sparkle";
requirement = {
kind = exactVersion;
version = 2.6.0;
version = 2.6.2;
};
};
4BADD55C283ABD0200C6B16D /* XCRemoteSwiftPackageReference "swift-collections" */ = {

View File

@ -13,10 +13,6 @@ final class AdvancedPrefReducer: ReducerType {
var state = pair.state
switch pair.action {
case let .setUseLiveResize(value):
state.mainWindowTemplate.useLiveResize = value
state.mainWindows.keys.forEach { state.mainWindows[$0]?.useLiveResize = value }
case let .setUseInteractiveZsh(value):
state.mainWindowTemplate.useInteractiveZsh = value

View File

@ -13,7 +13,6 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
enum Action {
case setUseInteractiveZsh(Bool)
case setUseSnapshotUpdate(Bool)
case setUseLiveResize(Bool)
case setNvimBinary(String)
}
@ -30,7 +29,6 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
self.useInteractiveZsh = state.mainWindowTemplate.useInteractiveZsh
self.useSnapshotUpdate = state.useSnapshotUpdate
self.useLiveResize = state.mainWindowTemplate.useLiveResize
self.nvimBinary = state.mainWindowTemplate.nvimBinary
super.init(frame: .zero)
@ -44,12 +42,10 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
if self.useInteractiveZsh != state.mainWindowTemplate.useInteractiveZsh
|| self.nvimBinary != state.mainWindowTemplate.nvimBinary
|| self.useSnapshotUpdate != state.useSnapshotUpdate
|| self.useLiveResize != state.mainWindowTemplate.useLiveResize
{
self.useInteractiveZsh = state.mainWindowTemplate.useInteractiveZsh
self.nvimBinary = state.mainWindowTemplate.nvimBinary
self.useSnapshotUpdate = state.useSnapshotUpdate
self.useLiveResize = state.mainWindowTemplate.useLiveResize
self.updateViews()
}
@ -62,12 +58,10 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
private var useInteractiveZsh: Bool
private var useSnapshotUpdate: Bool
private var useLiveResize: Bool
private var nvimBinary: String = ""
private let useInteractiveZshCheckbox = NSButton(forAutoLayout: ())
private let useSnapshotUpdateCheckbox = NSButton(forAutoLayout: ())
private let useLiveResizeCheckbox = NSButton(forAutoLayout: ())
private let nvimBinaryField = NSTextField(forAutoLayout: ())
@available(*, unavailable)
@ -82,7 +76,6 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
private func updateViews() {
self.useSnapshotUpdateCheckbox.boolState = self.useSnapshotUpdate
self.useInteractiveZshCheckbox.boolState = self.useInteractiveZsh
self.useLiveResizeCheckbox.boolState = self.useLiveResize
self.nvimBinaryField.stringValue = self.nvimBinary
}
@ -115,18 +108,6 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
of VimR in no time!
"""#)
let useLiveResize = self.useLiveResizeCheckbox
self.configureCheckbox(
button: useLiveResize,
title: "Use Live Window Resizing",
action: #selector(AdvancedPref.useLiveResizeAction(_:))
)
let useLiveResizeInfo = self.infoTextField(markdown: #"""
The Live Resizing is yet experimental. You may experience some issues.\
If you do, please report them at [GitHub](https://github.com/qvacua/vimr/issues).
"""#)
let nvimBinaryTitle = self.titleTextField(title: "NeoVim Binary:")
let nvimBinaryField = self.nvimBinaryField
@ -136,8 +117,6 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
self.addSubview(useSnapshotUpdateInfo)
self.addSubview(useInteractiveZsh)
self.addSubview(useInteractiveZshInfo)
self.addSubview(useLiveResize)
self.addSubview(useLiveResizeInfo)
self.addSubview(nvimBinaryTitle)
self.addSubview(nvimBinaryField)
@ -145,30 +124,24 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
paneTitle.autoPinEdge(toSuperviewEdge: .left, withInset: 18)
paneTitle.autoPinEdge(toSuperviewEdge: .right, withInset: 18, relation: .greaterThanOrEqual)
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)
useSnapshotUpdate.autoPinEdge(.top, to: .bottom, of: useLiveResizeInfo, withOffset: 18)
useSnapshotUpdate.autoPinEdge(.left, to: .left, of: useLiveResize, withOffset: 5)
useSnapshotUpdate.autoPinEdge(.top, to: .bottom, of: paneTitle, withOffset: 18)
useSnapshotUpdate.autoPinEdge(.left, to: .left, of: paneTitle)
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: .left, of: useLiveResize, withOffset: 5)
useInteractiveZsh.autoPinEdge(.left, to: .left, of: useSnapshotUpdate)
useInteractiveZshInfo.autoPinEdge(.top, to: .bottom, of: useInteractiveZsh, withOffset: 5)
useInteractiveZshInfo.autoPinEdge(.left, to: .left, of: useInteractiveZsh)
nvimBinaryTitle.autoPinEdge(.top, to: .bottom, of: useInteractiveZshInfo, withOffset: 18)
nvimBinaryTitle.autoPinEdge(.left, to: .left, of: useLiveResize, withOffset: 5)
nvimBinaryTitle.autoPinEdge(.left, to: .left, of: useSnapshotUpdate)
// nvimBinaryTitle.autoAlignAxis(.baseline, toSameAxisOf: nvimBinaryField)
nvimBinaryField.autoPinEdge(.top, to: .bottom, of: useInteractiveZshInfo, withOffset: 18)
nvimBinaryField.autoPinEdge(.left, to: .right, of: nvimBinaryTitle, withOffset: 5)
nvimBinaryField.autoPinEdge(.left, to: .right, of: nvimBinaryTitle)
nvimBinaryField.autoPinEdge(toSuperviewEdge: .right, withInset: 18)
nvimBinaryField.autoSetDimension(.height, toSize: 20, relation: .greaterThanOrEqual)
NotificationCenter.default.addObserver(
@ -182,10 +155,6 @@ final class AdvancedPref: PrefPane, UiComponent, NSTextFieldDelegate {
// MARK: - Actions
extension AdvancedPref {
@objc func useLiveResizeAction(_ sender: NSButton) {
self.emit(.setUseLiveResize(sender.boolState))
}
@objc func useInteractiveZshAction(_ sender: NSButton) {
self.emit(.setUseInteractiveZsh(sender.boolState))
}

View File

@ -350,9 +350,9 @@ extension AppDelegate {
self.emit(.openInKeyWindow(config: config))
case .separateWindows:
urls.forEach {
for url in urls {
let config = OpenConfig(
urls: [$0],
urls: [url],
cwd: cwd,
cliPipePath: pipePath,
nvimArgs: nil,

View File

@ -110,7 +110,7 @@ final class Context: ReduxContext {
}
private func cleanUpAppState() {
self.state.mainWindows.keys.forEach { uuid in
for uuid in self.state.mainWindows.keys {
self.state.mainWindows[uuid]?.cwdToSet = nil
self.state.mainWindows[uuid]?.currentBufferToSet = nil
self.state.mainWindows[uuid]?.viewToBeFocused = nil

View File

@ -129,7 +129,7 @@ final class FuzzySearchService {
let foldersToScan = try context.fetch(req)
// We use the ID of objects since we reset in scanScore(), which resets all properties of
// foldersToScan after first folderToScan.
foldersToScan.forEach { folder in
for folder in foldersToScan {
self.scanScore(
matcher: matcher,
folderId: folder.objectID,
@ -331,7 +331,9 @@ final class FuzzySearchService {
return
}
for child in folder.children ?? [] { ctx.delete(child) }
for child in folder.children ?? [] {
ctx.delete(child)
}
folder.needsScanChildren = true
self.log.trace("Marked \(folder.url!) for scanning")

View File

@ -1224,7 +1224,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.47.0</string>
<string>0.47.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -1241,7 +1241,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>20240528.165939</string>
<string>20240531.221846</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>

View File

@ -158,7 +158,7 @@ extension MainWindow {
(
colorName: colorName,
observable: self.neoVimView.api
.getHl(
.nvimGetHl(
ns_id: 0,
opts: ["name": MessagePackValue(colorName)]
)

View File

@ -176,9 +176,9 @@ final class MainWindow: NSObject,
self.usesTheme = state.appearance.usesTheme
state.orderedTools.forEach { toolId in
for toolId in state.orderedTools {
guard let tool = tools[toolId] else {
return
continue
}
self.workspace.append(
@ -187,7 +187,7 @@ final class MainWindow: NSObject,
)
}
self.tools.forEach { toolId, toolContainer in
for (toolId, toolContainer) in self.tools {
if state.tools[toolId]?.open == true {
toolContainer.toggle()
}
@ -207,7 +207,6 @@ final class MainWindow: NSObject,
self.addViews(withTopInset: 0)
self.neoVimView.usesLiveResize = state.useLiveResize
self.neoVimView.delegate = self
self.updateNeoVimAppearance()
@ -428,10 +427,6 @@ final class MainWindow: NSObject,
self.neoVimView.isLeftOptionMeta = state.isLeftOptionMeta
self.neoVimView.isRightOptionMeta = state.isRightOptionMeta
if self.neoVimView.usesLiveResize != state.useLiveResize {
self.neoVimView.usesLiveResize = state.useLiveResize
}
if self.defaultFont != state.appearance.font
|| self.linespacing != state.appearance.linespacing
|| self.characterspacing != state.appearance.characterspacing
@ -482,9 +477,9 @@ final class MainWindow: NSObject,
tabsTheme.selectedForegroundColor = self.theme.highlightForeground
tabsTheme.selectedBackgroundColor = self.theme.highlightBackground
tabsTheme.tabBackgroundColor = self.theme.tabBackground;
tabsTheme.tabForegroundColor = self.theme.tabForeground;
tabsTheme.tabBackgroundColor = self.theme.tabBackground
tabsTheme.tabForegroundColor = self.theme.tabForeground
tabsTheme.tabSelectedIndicatorColor = self.theme.highlightForeground

View File

@ -53,7 +53,7 @@ final class MainWindowReducer: ReducerType {
case let .setToolsState(tools):
state.orderedTools = []
tools.forEach { toolPair in
for toolPair in tools {
let toolId = toolPair.0
let tool = toolPair.1

View File

@ -202,17 +202,17 @@ final class OpenQuicklyWindow: NSObject,
let newUrls = urlsToMonitor.subtracting(currentUrls)
let obsoleteUrls = currentUrls.subtracting(urlsToMonitor)
newUrls.forEach { url in
for url in newUrls {
self.log.info("Adding \(url) and its service.")
guard let service = try? FuzzySearchService(root: url) else {
self.log.error("Could not create FileService for \(url)")
return
continue
}
self.searchServicePerRootUrl[url] = service
}
obsoleteUrls.forEach { url in
for url in obsoleteUrls {
self.log.info("Removing \(url) and its service.")
self.searchServicePerRootUrl.removeValue(forKey: url)
}

View File

@ -21,7 +21,7 @@ final class PrefWindow: NSObject,
weak var shortcutService: ShortcutService? {
didSet {
let shortcutsPref = self.panes.first { pane in pane is ShortcutsPref } as? ShortcutsPref
shortcutsPref?.shortcutService = shortcutService
shortcutsPref?.shortcutService = self.shortcutService
}
}

View File

@ -103,7 +103,7 @@ final class ShortcutsPref: PrefPane,
return
}
legacyDefaultShortcuts.forEach { id in
for id in legacyDefaultShortcuts {
let shortcut: Shortcut? = if let dict = self.shortcutsUserDefaults?
.value(forKey: id) as? [String: Any]
{
@ -121,7 +121,7 @@ final class ShortcutsPref: PrefPane,
private func initShortcutUserDefaults() {
let transformer = ShortcutValueTransformer.shared
defaultShortcuts.forEach { id, shortcut in
for (id, shortcut) in defaultShortcuts {
if self.shortcutsUserDefaults?.value(forKey: id) == nil {
let shortcutData = transformer.reverseTransformedValue(shortcut) as? NSData
self.shortcutsUserDefaults?.set(shortcutData, forKey: id)

View File

@ -304,8 +304,6 @@ extension MainWindow {
var fileBrowserShowHidden = false
var useLiveResize = false
var isTemporarySession = false
var customMarkdownProcessor = ""
@ -381,10 +379,7 @@ extension MainWindow {
)
self.nvimBinary = try container.decodeIfPresent(String.self, forKey: .nvimBinary) ?? State
.default.nvimBinary
self.useLiveResize = try container.decode(
forKey: .useLiveResize,
default: State.default.useLiveResize
)
if let frameRawValue = try container.decodeIfPresent(String.self, forKey: .frame) {
self.frame = NSRectFromString(frameRawValue)
} else {
@ -436,7 +431,7 @@ extension MainWindow {
return (tool, value)
}
let missingTools = MainWindow.Tools.all.subtracting(self.tools.keys)
missingTools.forEach { missingTool in
for missingTool in missingTools {
self.tools[missingTool] = MainWindow.State.defaultTools[missingTool]!
}
@ -457,7 +452,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.useLiveResize, forKey: .useLiveResize)
try container.encode(self.customMarkdownProcessor, forKey: .customMarkdownProcessor)
try container.encode(self.isLeftOptionMeta, forKey: .isLeftOptionMeta)
try container.encode(self.isRightOptionMeta, forKey: .isRightOptionMeta)

View File

@ -45,8 +45,8 @@ struct Theme: CustomStringConvertible {
var highlightBackground = NSColor.selectedContentBackgroundColor
var directoryForeground = NSColor.textColor
var tabForeground = NSColor.selectedMenuItemTextColor
var tabForeground = NSColor.selectedMenuItemTextColor
var tabBackground = NSColor.selectedContentBackgroundColor
var cssColor = NSColor(hex: "24292e")!
@ -80,10 +80,10 @@ struct Theme: CustomStringConvertible {
self.highlightBackground = nvimTheme.visualBackground
self.directoryForeground = nvimTheme.directoryForeground
self.tabBackground = nvimTheme.tabBackground
self.tabForeground = nvimTheme.tabForeground
self.tabBackground = nvimTheme.tabBackground
self.tabForeground = nvimTheme.tabForeground
self.updateCssColors(additionalColorDict)
}

View File

@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.47.0</string>
<string>0.47.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>20240528.165939</string>
<string>20240531.221846</string>
</dict>
</plist>

View File

@ -6,22 +6,27 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>v0.47.0-20240528.165939</title>
<title>v0.47.2-20240531.221846</title>
<link>https://twitter.com/vimrefined</link>
<sparkle:version>20240528.165939</sparkle:version>
<sparkle:shortVersionString>v0.47.0</sparkle:shortVersionString>
<sparkle:version>20240531.221846</sparkle:version>
<sparkle:shortVersionString>v0.47.2</sparkle:shortVersionString>
<description><![CDATA[
<ul>
<li>Neovim 0.10.0 😀</li>
<li>Always use live resizing</li>
<li>Dependencies updates:<ul>
<li>sparkle-project/Sparkle@2.7.2</li>
<li>ReactiveX/RxSwift@6.7.1</li>
</ul>
</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/v0.47.0-20240528.165939
https://github.com/qvacua/vimr/releases/tag/v0.47.2-20240531.221846
</releaseNotesLink>
<pubDate>2024-05-28T17:03:39.120989</pubDate>
<pubDate>2024-05-31T22:25:28.381821</pubDate>
<minimumSystemVersion>12.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.0-20240528.165939/VimR-v0.47.0.tar.bz2"
sparkle:edSignature="vPiDcu8cArjCrgbZIboNq6g8xwCK6zE8nS4l8vtlEiDPhC0+KzCd9ELuJ679B/xDiZerYMQfRcKv+h3IRGs9Dg==" length="19380666"
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.2-20240531.221846/VimR-v0.47.2.tar.bz2"
sparkle:edSignature="sYb/KT0vh65Q4DlTe9hKmWu8bGeINujGEjF0Ozsl6MQlwt3wjKJkSZjif/stJE9vHDfr8ggDxhxCvWgt47aoBQ==" length="19388603"
type="application/octet-stream"/>
</item>
</channel>

View File

@ -6,22 +6,27 @@
<description>Most recent changes with links to updates for VimR.</description>
<language>en</language>
<item>
<title>v0.47.0-20240528.165939</title>
<title>v0.47.2-20240531.221846</title>
<link>https://twitter.com/vimrefined</link>
<sparkle:version>20240528.165939</sparkle:version>
<sparkle:shortVersionString>v0.47.0</sparkle:shortVersionString>
<sparkle:version>20240531.221846</sparkle:version>
<sparkle:shortVersionString>v0.47.2</sparkle:shortVersionString>
<description><![CDATA[
<ul>
<li>Neovim 0.10.0 😀</li>
<li>Always use live resizing</li>
<li>Dependencies updates:<ul>
<li>sparkle-project/Sparkle@2.7.2</li>
<li>ReactiveX/RxSwift@6.7.1</li>
</ul>
</li>
</ul>
]]></description>
<releaseNotesLink>
https://github.com/qvacua/vimr/releases/tag/v0.47.0-20240528.165939
https://github.com/qvacua/vimr/releases/tag/v0.47.2-20240531.221846
</releaseNotesLink>
<pubDate>2024-05-28T17:03:39.120989</pubDate>
<pubDate>2024-05-31T22:25:28.381821</pubDate>
<minimumSystemVersion>12.0</minimumSystemVersion>
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.0-20240528.165939/VimR-v0.47.0.tar.bz2"
sparkle:edSignature="vPiDcu8cArjCrgbZIboNq6g8xwCK6zE8nS4l8vtlEiDPhC0+KzCd9ELuJ679B/xDiZerYMQfRcKv+h3IRGs9Dg==" length="19380666"
<enclosure url="https://github.com/qvacua/vimr/releases/download/v0.47.2-20240531.221846/VimR-v0.47.2.tar.bz2"
sparkle:edSignature="sYb/KT0vh65Q4DlTe9hKmWu8bGeINujGEjF0Ozsl6MQlwt3wjKJkSZjif/stJE9vHDfr8ggDxhxCvWgt47aoBQ==" length="19388603"
type="application/octet-stream"/>
</item>
</channel>

View File

@ -1,24 +0,0 @@
#!/bin/bash
set -Eeuo pipefail
readonly clean=${clean:?"true or false: when true, xcodebuild clean will be performed"}
main() {
if [[ "${clean}" == true ]]; then
local -r cmd="clean build"
else
local -r cmd="build"
fi
pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null
xcodebuild \
-workspace VimR.xcworkspace \
-derivedDataPath ./build \
-configuration Release \
-scheme VimR \
-xcconfig ./VimR/Dev.xcconfig \
${cmd}
popd >/dev/null
}
main

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -Eeuo pipefail
readonly clean=${clean:?"true or false"}
clean=${clean:?"true or false"}
readonly use_committed_nvim=${use_committed_nvim:?"If true, checkout the committed version of nvim, otherwise use the workspace."}
main() {
@ -25,15 +25,15 @@ main() {
echo "### Using nvim version: $nvim_version"
for_dev=true ../bin/build_nvimserver.sh
popd > /dev/null
pushd Neovim
version=${nvim_version} ../bin/generate_autocmds.py > "../NvimView/Sources/NvimView/NvimAutoCommandEvent.generated.swift"
version=${nvim_version} ../bin/generate_cursor_shape.py > "../NvimView/Sources/NvimView/NvimCursorModeShape.generated.swift"
swiftformat "../NvimView/Sources/NvimView/NvimAutoCommandEvent.generated.swift"
swiftformat "../NvimView/Sources/NvimView/NvimCursorModeShape.generated.swift"
popd > /dev/null
clean=false ./RxPack/bin/generate_sources.sh
popd > /dev/null
echo "### Successfully generated autocmds."
}

View File

@ -1,13 +0,0 @@
#!/bin/bash
set -Eeuo pipefail
pushd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null
pushd ./Neovim
rm -rf ./build
rm -rf ./.deps
make distclean
popd
popd >/dev/null

View File

@ -35,8 +35,7 @@ main () {
for f in "${vimr_app_path}/Contents/Resources/NvimView_NvimView.bundle/Contents/Resources/runtime/parser"/*; do
codesign --verbose --force -s "${identity}" --timestamp --options=runtime \
--entitlements="${entitlements_path}" \
"${f}"
"${f}"
done
codesign --verbose --force -s "${identity}" --deep --timestamp --options=runtime \

View File

@ -42,7 +42,6 @@ releaseVimRJob.with {
publishers {
archiveArtifacts {
pattern('Neovim/build/**, build/Build/Products/Release/**, release.spec.sh, release-notes.temp.md, appcast*, build_release.temp.sh')
onlyIfSuccessful()
}
}
}
@ -78,7 +77,6 @@ nightlyVimRJob.with {
publishers {
archiveArtifacts {
pattern('Neovim/build/**, build/Build/Products/Release/**')
onlyIfSuccessful()
}
}
}

View File

@ -1,5 +1,17 @@
# Next
* Always use live resizing
* Dependencies updates:
- sparkle-project/Sparkle@2.7.2
- ReactiveX/RxSwift@6.7.1
# v0.47.1-20240528.171603
* Neovim 0.10.0 😀
- 0.47.0 did not contain the generated API methods for Neovim 0.10.0...
# v0.47.0-20240528.165939
* Neovim 0.10.0 😀
# v0.46.2-20240517.102525