d11wtq / ctrlp_bdelete.vim

An extension to ctrlp.vim for deleting open buffers
58 stars 14 forks source link

fname parsed incorrectly - unnamed buffers #9

Open j5shi opened 8 years ago

j5shi commented 8 years ago

Sometimes the fname will be parsed as (I've no idea why it happens in that way):

C:\Program Files (x86)\vim\[18*No Name]

So the result of regex matchstr(fname, '\d\+') will be 86, which is obviously incorrect.

j5shi commented 8 years ago

You can use str2nr(matchstr(matchstr(fname, '\[\d\+\*No Name\]$'), '\d\+')) to solve it.