micro-editor / micro-editor/micro

ResizePane() resizes first/the most left pane

Open
#3,046 3 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

I want a sidebar (from the right side) so what I do:

  1. Create buffer
  2. Create split index from the buffer
  3. Use ResizePane function on freshly created pane of sidebar
local sidebar_buf = buffer.NewBuffer("", "sidebar")

-- true here means to create it from right
sidebar =  bp:VSplitIndex(sidebar_buf, true)

sidebar:ResizePane(35)
What I expect:

Sidebar shrinks to size 35.

What I get:

The opened file that is on the left side shrinks to size 35

After getting something wrong I decided to try another thing. I decided to create sidebar on the left side and see what I will get. When I created the sidebar on the left side and tried to change it is size, I saw that this time it worked as expected. The sidebar shrink but I think it is only because it was on the left side and the function has a bug. It doesn't actually resize pane from which it was called. It just resizes the most left pane

Specifications

Commit hash: Version: 2.0.11 (it doesn't show commit hash)
OS: Debian 12
Terminal: foot

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 ResizePane() and VSplitIndex() entry points in the Go code and reproduce the right-side split case from the report. Compare which pane is selected for resizing on left- and right-created sidebars. Done means ResizePane() changes the pane it was called on in both 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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.