Sunday, January 5, 2014

Re: Netrw tripping over itself: tree-view, modified buffers, and disregarding the `hidden` option

On Sunday, January 5, 2014 6:08:25 AM UTC+1, Ivan wrote:
> I'm running into a two-part problem with Netrw:
>
> 1. Netrw is ignoring the `hidden` option, so even though I have `hidden` set, it won't open a buffer in the previous window if that window contains a modified buffer.
>
> 2. In "tree" view, the explorer buffer often gets marked as "modified", preventing a buffer from opening in the current window.
>
> I can illustrate with this minimal .vimrc,
>
> set nocompatible
> set encoding=utf-8
> filetype plugin indent on
> set hidden
> let g:netrw_liststyle=3
>
> and the following workflow:
>
> - Start Vim
> - Insert some text
> - Run `:Vexplore`
> - Navigate the tree to an existing file
> - Hit `P` to open it in the previous window
>
> Because it isn't respecting the `hidden` option, Netrw won't open the file in the desired window, and instead tries to open it in the current one. But the Netrw buffer occupying the current window has somehow become marked as modified, so Vim displays the following prompt: "Save modified file<NetrwTreeListing 1>?"
>
> While issue #2 is a bit of an edge case, #1 is a significant problem for me. Is Dr. Chip out there? Is anyone else having this problem?
>
> Version info:
> Vim 7.4 (2013 Aug 10, compiled Oct 23 2013), MacOS X (unix) version, Patches 1-22, Compiled by Homebrew, Huge version with MacVim GUI

Hi Ivan,
yea, I'm on Netrw v150j, and I can reproduce the first problem.
After I hit 'P', (and the previous buffer is modified) I get this:
"Save modified file<NetrwTreeListing 1>?
[Y]es, (N)o, (C)ancel:"

I don't know how to reproduce the second issue you mentioned though.

Just FYI, installing the latest version from Dr. Chip's website helps sometimes:
http://www.drchip.org/astronaut/vim/index.html#NETRW
It's a pitty this isn't available from github (so we can install it via pathogen/Vundle)

I also reported an issue with netrw 'tree mode' a couple months back and Dr. Chip resolved the issue since. Here's my bug report:
https://groups.google.com/forum/?fromgroups=#!search/%5Bbug%5D$20netrw$20with$20netrw_liststyle/vim_dev/07wTmXWz2EU/1JCCLeffavsJ

So, if it's any consolation, Dr. Chip is still actively maintaining the plugin and fixing bugs (doing a good job I think btw.).
On the flipside, yea, there's a lot of bugs (especially for non-standard workflows) and the repo + issue tracking is non existant.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment