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

Buffer local swaplist #14

Merged
merged 4 commits into from
Jun 2, 2014
Merged

Conversation

inkarkat
Copy link
Contributor

@inkarkat inkarkat commented Jun 2, 2014

With only one global g:swap_lists, setting the swaplist for one filetype overrides the previous filetype's list. This breaks swapping with multiple filetypes in parallel (e.g. a PHP and CSS file); the last opened filetype "wins".

Instead, a buffer-local variable should be used. Each buffer has its own swaplist (according to its filetype / manual :SwapList) definition then.

inkarkat added 4 commits June 2, 2014 16:05
With only one global g:swap_lists, setting the swaplist for one filetype overrides the previous filetype's list. This breaks swapping with multiple filetypes in parallel (e.g. a PHP and CSS file); the last opened filetype "wins".

Instead, a buffer-local variable should be used. Each buffer has its own swaplist (according to its filetype / manual :SwapList) definition then.
As this configuration is filetype-specific, too.
Also, I've removed the duplicate multi-word swap list comment from the plugin, as this is already explained at :help swapit-multiword. Probably, a lot more unnecessary stuff should be cut from the plugin's comment header.
mjbrownie added a commit that referenced this pull request Jun 2, 2014
@mjbrownie mjbrownie merged commit 349e663 into mjbrownie:master Jun 2, 2014
@mjbrownie
Copy link
Owner

Cheers, Thanks for this update. I was never happy with the original setup and the :ClearSwapList command was always a bit of a hack.

Speaking of FileType lists do you have any worth publishing? I was hoping for contributions (perhaps as separate archives).

@inkarkat
Copy link
Contributor Author

inkarkat commented Jun 3, 2014

Thank you for accepting all my recent pull requests so quickly.

I have customized your lists for CSS and HTML a bit, and added one swap list for ActionScript, but I mostly use an extended set of default swaps. Having more default swaps would be nice, on the other hand, it's also easy to set them up yourself.

@mjbrownie
Copy link
Owner

No probs. I'll try and publish the updates soon on vim.org. I have an optional syntax_hightlight feature I just cooked up that I'll post as well once it's working.

@inkarkat inkarkat deleted the buffer-local-swaplist branch June 4, 2014 10: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.

2 participants