Feature Request: update file's centered location based on current Narrow_Region #24

Closed
dsummersl opened this Issue Jan 10, 2014 · 6 comments

Comments

Projects
None yet
3 participants

Just finally getting around to appreciating this awesome plugin (sorry it took me so long!). The multi-select feature I've been finding particularly helpful.

One feature I'd love to see (particularly with multi-select) is when you change your cursor location in the 'narrow_region' window to say , 'NrrwRgn17', the parent file's cursor location jumps to the location of that NrrwRgn17 originated from. I think this would provide some very helpful context information in the midst of editing.

Thanks for the great plugin,

Dane

Owner

chrisbra commented Jan 13, 2014

Hm, I am not sure I understand you. You want to have the main window update to whatever region the cursor is in the narrowed window, whenever you jump into the narrowed window? I'll need to think about it how to implement this.

He seems to be suggesting that any time you change lines in the narrow region, you center the original window on "the corresponding line". However, since you can change the number of lines in the highlighted section, I can't think of a good way to implement this. If it were to be implemented, it should definitely be optional and disabled by default in my opinion.

Something like that - I'm not suggesting strict line-by-line scrollbind like behavior.

This would address the case where one uses the NRMulti feature with many regions marked with NRP. In this case I think it'd be nice if the line number of the parent window changes the line number when you enter a new 'NrrwRgnX' block of the temporary buffer.

Owner

chrisbra commented Jan 27, 2014

Hi Dane!

On Fr, 10 Jan 2014, Dane Summers wrote:

Just finally getting around to appreciating this awesome plugin (sorry it took me so long!). The multi-select feature I've been finding particularly helpful.

One feature I'd love to see (particularly with multi-select) is when you change your cursor location in the 'narrow_region' window to say , 'NrrwRgn17', the parent file's cursor location jumps to the location of that NrrwRgn17 originated from. I think this would provide some very helpful context information in the midst of editing.

Thanks for the great plugin,

please check, if commit #86cc4151217aa works for you. You need to set
g:nrrw_rgn_update_orig_win to 1 in order to update the original window.

Best,

Christian

Jenkinson's Law:
It won't work.

Christian,

Awesome, it totally works! I did notice that there is one slight inconsistency: the documentation references g:nrrw_rgn_update_orig_win but the actual code uses g:narrow_rgn_update_orig_win (I assume you wanted the former). Once I figured that little bit out, it worked like a charm.

Thanks so much for adding this,

Dane

Owner

chrisbra commented Jan 28, 2014

Thanks for noticing. I'll fixed it.

@chrisbra chrisbra closed this in 396ad78 Jan 28, 2014

chrisbra pushed a commit that referenced this issue Jan 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment