Bug#486417: [vim-runtime] GUI menu "Window -> Split File Explorer" does not work if the path has special characters

Teemu Likonen tlikonen at iki.fi
Sun Jun 15 22:47:20 UTC 2008


Package: vim-runtime
Version: 1:7.1.293-3
Severity: normal
Tags: patch

The GUI menu option "Window -> Split File Explorer" (provided by
runtime/menu.vim) does not work if the current file's path/name contains
spaces and some special characters. The attached patch (made with "git
format-patch") fixes the issue by backslash-escaping many characters.

Recent Vim versions (starting from 7.1.299, I think) contains new function
fnameescape() which I believe will be used in the future.
-------------- next part --------------
>From 8da38ff6455fff9a2f422657c3a4e67134ec6bd2 Mon Sep 17 00:00:00 2001
From: Teemu Likonen <tlikonen at iki.fi>
Date: Mon, 16 Jun 2008 00:34:48 +0300
Subject: [PATCH] menu.vim: Escape special characters when opening file explorer

If current file's path contains spaces or other special characters the
GUI menu option "Window -> Split File Explorer" does not work. This
patch adds escape() funtion to escape spaces and double quotes.

Signed-off-by: Teemu Likonen <tlikonen at iki.fi>
---
 runtime/menu.vim |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/runtime/menu.vim b/runtime/menu.vim
index f0c0d69..3832bb8 100644
--- a/runtime/menu.vim
+++ b/runtime/menu.vim
@@ -806,7 +806,7 @@ if has("vertsplit")
       if @% == ""
 	20vsp .
       else
-	exe "20vsp " . expand("%:p:h")
+	exe "20vsp " . escape(expand("%:p:h"), " \t\n*?[{`$\\%#'\"|!<")
       endif
     endfun
   endif
-- 
1.5.6.rc3.2.g8f2dd



More information about the pkg-vim-maintainers mailing list