Skip to content

feat: Custom open file handler#74

Merged
mikew merged 3 commits intomainfrom
new-branch-1769914960
Feb 1, 2026
Merged

feat: Custom open file handler#74
mikew merged 3 commits intomainfrom
new-branch-1769914960

Conversation

@mikew
Copy link
Owner

@mikew mikew commented Feb 1, 2026

This allows people to implement their own handling when the $EDITOR script is called.

---@param filename string
---@param line number?
---@param col number?
_G.nvrh_open_file_handler = function(filename, line, col)
  vim.cmd.vsplit(filename)

  if line ~= nil then
    local window = vim.api.nvim_get_current_win()
    -- Note that `col` may be nil even though `line` is set.
    pcall(vim.api.nvim_win_set_cursor, window, { line, col or 0 })
  end
end

@mikew mikew merged commit 4649eb0 into main Feb 1, 2026
6 checks passed
@mikew mikew deleted the new-branch-1769914960 branch February 1, 2026 03:16
mikew pushed a commit that referenced this pull request Feb 2, 2026
🤖 I have created a release *beep* *boop*
---


## [0.7.0](v0.6.0...v0.7.0)
(2026-02-01)


### Features

* Custom open file handler
([#74](#74))
([4649eb0](4649eb0))


### Bug Fixes

* Document configuration file
([#73](#73))
([53bca4e](53bca4e))
* Refactor bridge files ([#76](#76))
([91dba24](91dba24))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant