diff --git a/DEVELOP.md b/DEVELOP.md index cd6aaeea..c35afa26 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -1,32 +1,12 @@ ## How to develop -### No change in NvimServer - -If you did not change NvimServer, i.e. NvimServer, NvimServerTypes, and neovim, -then, do the following to run VimR: - -* `./bin/download_nvimserver.sh` -* Run VimR scheme in Xcode - -A development version of VimR will be built and run, -i.e. the bundle identifier will be `com.qvacua.VimR.dev` and the name of the app will be `VimR-dev`. -If you want to build a development version as a release build, then use the following: +To build NvimServer, do the following ```bash -clean=true ./bin/build_vimr_dev.sh +build_libnvim=true clean=false ./bin/build_nvimserver_for_local_dev.sh ``` -### Changes in NvimServer - -Since SwiftPM does not support a script phase, we have to copy some files manually, -e.g. `NvimServer` binary. -This can be done with the following: - -```bash -build_libnvim=true clean=true ./bin/build_nvimserver_for_local_dev.sh -``` - -See the `build_nvimserver_for_local_dev` script for default values of the env vars. +You can set `clean=true` if you want to clean the existing build. You can also use a watch script as follows (it uses `entr`): ```bash @@ -36,6 +16,14 @@ clean_initial_build=true ./bin/watch_nvimserver_and_build When `clean_initial_build` is `true`, the script will clean and build, then continuously invoke the `build_nvimserver_for_local_dev` script. +## How to build nightly + +```bash +git tag -f neovim-nightly; git push -f origin neovim-nightly +``` + +Then, GitHub actions will build and re-create the release. + ## How to release * Set a new version of VimR via diff --git a/VimR/VimR/MainWindow+Actions.swift b/VimR/VimR/MainWindow+Actions.swift index 69a96fe3..fc9a0230 100644 --- a/VimR/VimR/MainWindow+Actions.swift +++ b/VimR/VimR/MainWindow+Actions.swift @@ -23,6 +23,13 @@ extension MainWindow { let params = Array(rawParams.suffix(from: 1)) switch event { + + case .refreshFileBrowser: + self.refreshFileBrowser() + + case .revealCurrentBufferInFileBrowser: + self.revealCurrentBufferInFileBrowser() + case .makeSessionTemporary: self.emit(self.uuidAction(for: .makeSessionTemporary)) diff --git a/VimR/VimR/MainWindow.swift b/VimR/VimR/MainWindow.swift index 3e49592f..308ce403 100644 --- a/VimR/VimR/MainWindow.swift +++ b/VimR/VimR/MainWindow.swift @@ -595,6 +595,14 @@ final class MainWindow: NSObject, Swift.print("fdsfd") } } + + func revealCurrentBufferInFileBrowser() { + self.fileBrowser?.scrollToSourceAction(nil) + } + + func refreshFileBrowser() { + self.fileBrowser?.refreshAction(nil) + } } // NvimViewDelegate diff --git a/VimR/VimR/RpcEvents.swift b/VimR/VimR/RpcEvents.swift index 32712c51..dc562612 100644 --- a/VimR/VimR/RpcEvents.swift +++ b/VimR/VimR/RpcEvents.swift @@ -17,4 +17,7 @@ enum RpcEvent: String, CaseIterable { case setFont = "com.qvacua.vimr.rpc-events.set-font" case setLinespacing = "com.qvacua.vimr.rpc-events.set-linespacing" case setCharacterspacing = "com.qvacua.vimr.rpc-events.set-characterspacing" + + case revealCurrentBufferInFileBrowser = "com.qvacua.vimr.rpc-events.reveal-current-buffer-in-file-browser" + case refreshFileBrowser = "com.qvacua.vimr.rpc-events.refresh-file-browser" } diff --git a/VimR/VimR/com.qvacua.VimR.vim b/VimR/VimR/com.qvacua.VimR.vim index c95e6b42..6adc8e1f 100644 --- a/VimR/VimR/com.qvacua.VimR.vim +++ b/VimR/VimR/com.qvacua.VimR.vim @@ -20,10 +20,23 @@ command! -nargs=0 VimRShowTools call s:VimRToggleTools(1) function! s:VimRToggleToolButtons(value) abort call rpcnotify(0, 'com.qvacua.NvimView', 'toggle-tool-buttons', a:value) endfunction + command! -nargs=0 VimRHideToolButtons call s:VimRToggleToolButtons(-1) command! -nargs=0 VimRToggleToolButtons call s:VimRToggleToolButtons(0) command! -nargs=0 VimRShowToolButtons call s:VimRToggleToolButtons(1) +function! s:VimRRevealCurrentBufferInFileBrowser() abort + if filereadable(expand('%')) + call rpcnotify(0, 'com.qvacua.NvimView', 'reveal-current-buffer-in-file-browser') + endif +endfunction +command! -nargs=0 VimRRevealCurrentBuffer call s:VimRRevealCurrentBufferInFileBrowser() + +function! s:VimRRefreshFileBrowser() abort + call rpcnotify(0, 'com.qvacua.NvimView', 'refresh-file-browser') +endfunction +command! -nargs=0 VimRRefreshFileBrowser call s:VimRRefreshFileBrowser() + function! s:VimRToggleFullscreen() abort call rpcnotify(0, 'com.qvacua.NvimView', 'toggle-fullscreen') endfunction diff --git a/resources/release-notes.md b/resources/release-notes.md index 3c9ae570..32efd788 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,6 +1,6 @@ # Next -* ... +* Add `VimRRefreshFileBrowser` and `VimRRevealCurrentBufferInFileBrowser` functions. Thanks @jaanauati for the PR! # 0.41.2-20220628.220813