@@ -169,7 +169,7 @@ endfunction
169
169
function ! NERDTreeAddNode ()
170
170
let curDirNode = g: NERDTreeDirNode .GetSelected ()
171
171
let prompt = s: inputPrompt (' add' )
172
- let newNodeName = trim (input (prompt , curDirNode.path .str () . nerdtree#slash (), ' file' ))
172
+ let newNodeName = substitute (input (prompt , curDirNode.path .str () . nerdtree#slash (), ' file' ), ' \(^\s*\|\s*$\) ' , ' ' , ' g ' )
173
173
174
174
if newNodeName == # ' '
175
175
call nerdtree#echo (' Node Creation Aborted.' )
@@ -206,7 +206,7 @@ function! NERDTreeMoveNode()
206
206
let newNodePath = input (prompt , curNode.path .str (), ' file' )
207
207
while filereadable (newNodePath)
208
208
call nerdtree#echoWarning (' This destination already exists. Try again.' )
209
- let newNodePath = trim (input (prompt , curNode.path .str (), ' file' ))
209
+ let newNodePath = substitute (input (prompt , curNode.path .str (), ' file' ), ' \(^\s*\|\s*$\) ' , ' ' , ' g ' )
210
210
endwhile
211
211
212
212
@@ -337,7 +337,7 @@ endfunction
337
337
function ! NERDTreeCopyNode ()
338
338
let currentNode = g: NERDTreeFileNode .GetSelected ()
339
339
let prompt = s: inputPrompt (' copy' )
340
- let newNodePath = trim (input (prompt , currentNode.path .str (), ' file' ))
340
+ let newNodePath = substitute (input (prompt , currentNode.path .str (), ' file' ), ' \(^\s*\|\s*$\) ' , ' ' , ' g ' )
341
341
342
342
if newNodePath !=# ' '
343
343
" strip trailing slash
0 commit comments