Permalink
Browse files

[Fixes #110]: translate Vim's 'latin1' encoding to Ruby's 'ISO-8859-1'

  • Loading branch information...
sjbach committed Feb 16, 2018
1 parent 95a3bf8 commit 7b93dc99b1e4a80dc20090561d8b4a99629e7165
Showing with 6 additions and 2 deletions.
  1. +3 −1 autoload/lustyexplorer.vim
  2. +3 −1 src/lusty/filesystem-explorer.rb
@@ -893,7 +893,9 @@ class FilesystemExplorer < Explorer
path = VIM::getcwd()
end
if path.respond_to?(:force_encoding)
- path = path.force_encoding(VIM::evaluate('&enc'))
+ encoding = VIM::evaluate('&enc')
+ encoding = 'ISO-8859-1' if encoding == 'latin1'
+ path = path.force_encoding(encoding)
end
@prompt.set!(path + File::SEPARATOR)
run()
@@ -31,7 +31,9 @@ def run_from_path(path)
path = VIM::getcwd()
end
if path.respond_to?(:force_encoding)
- path = path.force_encoding(VIM::evaluate('&enc'))
+ encoding = VIM::evaluate('&enc')
+ encoding = 'ISO-8859-1' if encoding == 'latin1'
+ path = path.force_encoding(encoding)
end
@prompt.set!(path + File::SEPARATOR)
run()

0 comments on commit 7b93dc9

Please sign in to comment.