fix(ftp): give oil-ftps:// its own adapter name to prevent scheme clobbering

Problem: both oil-ftp:// and oil-ftps:// mapped to the adapter name
'ftp', so config.adapter_to_scheme['ftp'] was set to whichever scheme
pairs() iterated last — non-deterministic. init.lua uses
adapter_to_scheme[adapter.name] to reconstruct the parent URL, so
roughly half the time it injected 'oil-ftps://' into ftp:// buffer
navigation, causing the ssl-reqd error on '-' press.

Solution: register oil-ftps:// under adapter name 'ftps' via a
one-line shim that returns require('oil.adapters.ftp'). Now
adapter_to_scheme['ftp'] = 'oil-ftp://' and
adapter_to_scheme['ftps'] = 'oil-ftps://' are both stable.
This commit is contained in:
Barrett Ruth 2026-03-17 22:24:21 -04:00
parent b7f475787e
commit 7274c9de46
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 2 additions and 1 deletions

View file

@ -226,7 +226,7 @@ default_config.adapters = {
[oil_s3_string] = 's3',
['oil-trash://'] = 'trash',
['oil-ftp://'] = 'ftp',
['oil-ftps://'] = 'ftp',
['oil-ftps://'] = 'ftps',
}
default_config.adapter_aliases = {}
-- We want the function in the default config for documentation generation, but if we nil it out