Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Resize" autocommand (via outerWidth/outerHeight) #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blueyed
Copy link

@blueyed blueyed commented Aug 20, 2014

Fixes: https://code.google.com/p/dactyl/issues/detail?id=1121

(only tested with Pentadactyl)

@kmaglione
Copy link
Contributor

Unless you can come up with a convincing use case for this, I'd rather not add it. It could be extremely expensive, and I can't imagine any uses which wouldn't require JavaScript in any case, so I'd prefer to just stick to pure JS.

@blueyed
Copy link
Author

blueyed commented Aug 27, 2014

@kmaglione
This is the code I am using currently, dynamically adjusting maxitems:

javascript <<EOF
function myAdjustMaxitems() {
  let maxitems=10
  if(window.innerHeight > 1000)
    maxitems = 20;
  if(window.innerHeight > 700)
    maxitems = 15;
  options['maxitems'] = maxitems;
}
EOF
autocmd -js Resize .* myAdjustMaxitems()

I can't imagine any uses which wouldn't require JavaScript in any case, so I'd prefer to just stick to pure JS.

Does this mean that this could be done without an autocmd?

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.

2 participants