Skip to content

feat(autocmd): add TabEnter autocmd#173

Open
suveshmoza wants to merge 4 commits into
glide-browser:mainfrom
suveshmoza:feat/tabenter-autocmd
Open

feat(autocmd): add TabEnter autocmd#173
suveshmoza wants to merge 4 commits into
glide-browser:mainfrom
suveshmoza:feat/tabenter-autocmd

Conversation

@suveshmoza
Copy link
Copy Markdown
Contributor

Closes #116

Add TabEnter autocmd

Used the GitHub Issue example from Autocmds for demo.

Screen.Recording.2025-12-21.at.13.59.11.mov

Copy link
Copy Markdown
Member

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some notes, will do a full review later:

  1. Right now all TabEnter autocmds must exit before we invoke UrlEnter autocmds. I'm not sure if this ordering is desired or not, can you check what neovim does for similar autocmds?
  2. You should update autocmds.md as well
  3. If we don't want the ordering mentioned in 1, then I think we could make this a thinner wrapper over the web extensions tab listener?

@suveshmoza suveshmoza force-pushed the feat/tabenter-autocmd branch from 6908623 to ba91a24 Compare December 23, 2025 19:39
@suveshmoza
Copy link
Copy Markdown
Contributor Author

suveshmoza commented Dec 23, 2025

  1. According to the Neovim tabpage docs (here), there’s a defined event order
When switching to another tab page the order is:
	BufLeave
	WinLeave
	TabLeave
	WinEnter
	TabEnter
	BufEnter
  1. Updated autocmds.md

Copy link
Copy Markdown
Member

@RobertCraigie RobertCraigie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I pushed a small docs change.

It looks like the "is tab switching" logic will need some adjustments to make it work for tabs that immediately load a new URI

Comment thread src/glide/browser/base/content/test/autocmds/browser_autocmds.ts
Comment thread src/glide/browser/base/content/browser.mts Outdated
@suveshmoza suveshmoza force-pushed the feat/tabenter-autocmd branch from 17be30d to 6c6435c Compare February 27, 2026 11:45
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.

Add a TabEnter autocmd

2 participants