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

Keep SessionLoadPost autocmd intact #25

Closed
wants to merge 2 commits into from
Closed

Keep SessionLoadPost autocmd intact #25

wants to merge 2 commits into from

Conversation

Konfekt
Copy link
Contributor

@Konfekt Konfekt commented Mar 3, 2016

Other plugins, such as FastFold, rely on the triggering of the SessionLoadPost autocmd after loadview. Therefore this pull request proposes to

  • keep it by default,
  • if things are slow, there's a FAQ entry and an option that disables it, and
  • even if users disable it, FastFold keeps functioning.

(Without the SessionLoadPost autocmd, FastFold does not switch to manual folding which makes editing large files with syntax or expr folding slow.)

@kopischke
Copy link
Collaborator

Thanks for the PR, but stay already fires the SessionLoadPost event every time a view session is loaded; it just does so in a somewhat more targeted way than the sweeping :doautoall of standard view session files. This has been so since version 1.2.0.

If that event did not fire for you, you might have stumbled on a bug in the plugin logic. In that case, I would ask you to help me track that exact bug by providing me with a way to reproduce it – introducing a user setting to compromise between integration or a performance penalty would be my very last resort.

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 3, 2016

Well, this is with

VIM - Vi IMproved 7.4 (2013 Aug 10)
Included patches: 1-1467
Compiled by 'http://www.opensuse.org/'

and I did not notice it with older versions. Maybe you can reproduce it with the latest Vim and FastFold as well?

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 3, 2016

Perhaps exists('#'.join(l:event, '#')) at https://github.com/kopischke/vim-stay/blob/v1.3.1/autoload/stay/view.vim#L101 is now case sensitive or something?

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 3, 2016

See,

echo exists('#SessionLoadPost#')

here gives 0.

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 3, 2016

Ok, also

b:stay_loaded_view

is not defined.

@kopischke
Copy link
Collaborator

Yes of course it does, the syntax is wrong in your test. Could you report what

:echo exists('#SessionLoadPost')

returns on your system? That is what is actually tested in the line you linked to: the second # is part of a join() when a pattern is present additionally to the event name.

@kopischke
Copy link
Collaborator

OK, b:stay_loaded_view being undefined sounds like the root cause of the problem. Could you tell me what your &viewdir is set to? And &eventignore, while you are at it?

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 3, 2016

Viewdir is ~/.cache/vim/view and eventignore empty

@Konfekt
Copy link
Contributor Author

Konfekt commented Mar 3, 2016

Well it is ... /view// and the stridx function returns -1. Adapting the if clause to check for - 1 solves everything.

@Konfekt Konfekt closed this Mar 3, 2016
@kopischke
Copy link
Collaborator

Adapting the if clause to check for - 1 solves everything.

Not really, as it subverts the check for “file is sourced from viewdir”, but it does pinpoint the issue: me checking far too naively for that exact condition. I’ll see that I get this fixed.

@kopischke
Copy link
Collaborator

@Konfekt FYI I am tracking this in #26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants