Skip to content

filemanager: fix mouse click handling, crashes, and header-click edge case - #28

Open
mp3cko wants to merge 3 commits into
micro-editor:masterfrom
mp3cko:master
Open

filemanager: fix mouse click handling, crashes, and header-click edge case#28
mp3cko wants to merge 3 commits into
micro-editor:masterfrom
mp3cko:master

Conversation

@mp3cko

@mp3cko mp3cko commented Sep 10, 2026

Copy link
Copy Markdown

Summary

  • Rework mouse click handling in the tree view to use pre/post handlers (preMousePress/onMousePress), letting Micro map the click to the correct buffer position instead of manually computing it — fixes incorrect click targeting when softwrap is enabled
  • Add nil checks around scanlist[y] and tree_view to prevent panics on stale/out-of-range clicks
  • Disable autocomplete in the tree view so Tab navigation works again (previously swallowed by the autocomplete popup)
  • Silently ignore clicks on the header (current dir path) and separator lines instead of erroring
  • Reduce default tree pane width from 30 to 25
  • Document the above in CHANGELOG.md under Unreleased

Test plan

  • Manually reviewed diff for correctness and consistency with existing plugin patterns
  • Manual smoke test in Micro: open tree, click files/dirs/header/separator/.., verify Tab navigation and no crashes

mp3cko added 3 commits June 13, 2026 00:55
- Refactor mouse press to use pre/post handlers so micro manages
  cursor positioning correctly with softwrap
- Add nil checks for scanlist[y] and tree_view to prevent panics
- Reduce default pane width from 30 to 25
- Disable autocomplete in tree view to restore Tab navigation
- Remove SelectLine call and reset selection on click
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