micro-editor / micro-editor/micro

new splits don't invoke `onSetActive`

Open
#3,563 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

The callback function onSetActive is not called when creating a split, for example via hsplit or vsplit. In contrast, it is called when creating a new tab. I think it should also be called for new splits because the bufpane changes. When navigating between bufpanes with NextSplit, onSetActive is called.

For completeness, here is the function I used to check this:

function onSetActive(bp)
    micro.TermMessage("onSetActive <", bp.Buf.Path, "> <", bp.Buf.AbsPath, "> <", bp:Name(), ">")
    return true
end

ADDED: Also, when closing a tab (i.e., closing a bufpane in a tab without split), onSetActive is not called for the bufpane that is activated in the next tab.

Specifications

Commit hash: fb208180
OS: Ubuntu
Terminal: urxvt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the code paths for creating splits via hsplit and vsplit, then compare them with new-tab creation and NextSplit, where onSetActive is already called. Also trace closing a tab and activating the next tab's bufpane. Done means onSetActive is invoked for newly active bufpanes in both split creation and tab closing cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.