Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add win_splitmove function, to move a window into split of a given window #4561

Closed
wants to merge 1 commit into from

Conversation

@andymass
Copy link

commented Jun 18, 2019

This essentially exposes the internal function win_split_ins().

Allows complex modifications of window layouts, for example, converting vertical splits to horizontal splits and moving a window from left stack of panes to a right stack of panes.

win_splitmove({nr}, {target} [, {options}])		*win_splitmove()*
	        Move the window {nr} to a new split of the window {target}.
		This is similar to moving to {target}, creating a new window
		using |:split| but having the same contents as window {nr}, and
		then closing {nr}.

		Both {nr} and {target} can be window numbers or |window-ID|s.

		{options} is a Dictionary with the following optional entries:
		  "vertical"	When TRUE, the split is created vertically,
				like with |:vsplit|.
		  "rightbelow"	When TRUE, the split is made below or to the
				right (if vertical).  When FALSE, it is done
				above or to the left (if vertical).  When not
				present, the values of 'splitbelow' and
				'splitright' are used.

There is also a "size" parameter to win_split_ins(), but it doesn't look like it doesn't even work e.g., 30wincmd K.

@codecov-io

This comment has been minimized.

Copy link

commented Jun 18, 2019

Codecov Report

Merging #4561 into master will increase coverage by 0.01%.
The diff coverage is 86.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4561      +/-   ##
==========================================
+ Coverage   81.66%   81.67%   +0.01%     
==========================================
  Files         126      126              
  Lines      146182   146219      +37     
==========================================
+ Hits       119378   119423      +45     
+ Misses      26804    26796       -8
Impacted Files Coverage Δ
src/evalfunc.c 90.61% <ø> (ø) ⬆️
src/evalwindow.c 91.97% <77.77%> (-0.58%) ⬇️
src/window.c 87.95% <94.73%> (+0.35%) ⬆️
src/gui_gtk_x11.c 58.11% <0%> (-0.3%) ⬇️
src/gui.c 63.7% <0%> (-0.06%) ⬇️
src/term.c 79.17% <0%> (-0.06%) ⬇️
src/terminal.c 81.92% <0%> (+0.03%) ⬆️
src/message.c 79.52% <0%> (+0.05%) ⬆️
src/channel.c 84.21% <0%> (+0.07%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 410e98a...6d1fe69. Read the comment docs.

@brammool

This comment has been minimized.

Copy link
Contributor

commented Sep 9, 2019

This looks useful. Since the windows need to be both referenced, doing this with a command gets difficult.
Can you please with the current head, and put the new function in evalwindow.c?

Add win_splitmove function, to move a window into
...a split of a given window.  Allows complex modifications of window
layouts, for example, converting vertical splits to horizontal splits
and moving a window from left stack of panes to a right stack of panes.

win_splitmove({nr}, {target} [, {options}])		*win_splitmove()*
	        Move the window {nr} to a new split of the window {target}.
		This is similar to moving to {target}, creating a new window
		using |:split| but having the same contents as window {nr}, and
		then closing {nr}.

		Both {nr} and {target} can be window numbers or |window-ID|s.

		{options} is a Dictionary with the following optional entries:
		  "vertical"	When TRUE, the split is created vertically,
				like with |:vsplit|.
		  "rightbelow"	When TRUE, the split is made below or to the
				right (if vertical).  When FALSE, it is done
				above or to the left (if vertical).  When not
				present, the values of 'splitbelow' and
				'splitright' are used.

@andymass andymass force-pushed the andymass:feature-splitmove branch from e49aeda to 6d1fe69 Sep 10, 2019

@andymass

This comment has been minimized.

Copy link
Author

commented Sep 10, 2019

Updated

@brammool brammool closed this in d20dcb3 Sep 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.