summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-choose-buffer.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move template defines back into .c files.nicm2014-10-201-1/+4
|
* Instead of setting up the default keys by building the key structnicm2014-10-201-2/+1
| | | | | | | | | directly with a helper function in the cmd_entry, include a table of bind-key commands and pass them through the command parser and a temporary cmd_q. As well as being smaller, this will allow default bindings to be command sequences which will probably be needed soon.
* Add support for named buffers. If you don't name a buffer, things worknicm2014-05-131-5/+6
| | | | | | | | much as before - buffers are automatically named "buffer0000", "buffer0001" and so on and ordered as a stack. Buffers can be named explicitly when creating ("loadb -b foo" etc) or renamed ("setb -b buffer0000 -n foo"). If buffers are named explicitly, they are not deleted when buffer-limit is reached. Diff from J Raynor.
* There is no longer a need for a paste_stack struct or for global_buffersnicm2014-04-241-3/+3
| | | | to be global. Move to paste.c.
* Support UTF-8 with choose-buffer, from Kosuke ASAMI. Also makenicm2014-04-021-2/+4
| | | | buffer_sample bigger to let it trim at window right edge.
* Remove the barely-used and unnecessary command check() function.nicm2013-10-101-2/+1
|
* Add a command queue to standardize and simplify commands that call othernicm2013-03-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | commands and allow a command to block execution of subsequent commands. This allows run-shell and if-shell to be synchronous which has been much requested. Each client has a default command queue and commands are consumed one at a time from it. A command may suspend execution from the queue by returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() - for example run-shell does this from the callback that is fired after the job is freed. When the command queue becomes empty, command clients are automatically exited (unless attaching). A callback is also fired - this is used for nested commands in, for example, if-shell which can block execution of the client's cmdq until a new cmdq becomes empty. Also merge all the old error/info/print functions together and lose the old curclient/cmdclient distinction - a cmdq is bound to one client (or none if in the configuration file), this is a command client if c->session is NULL otherwise an attached client.
* Allow choose commands to be used outside tmux, so long as at least onenicm2013-03-211-4/+3
| | | | client is attached.
* Remove free callback for window_choose_data objects.nicm2013-03-211-2/+2
|
* Miscellaneous tidying of choose API, including:nicm2013-03-211-34/+5
| | | | | | | | | | | | | | | | | - rename client and session to start_client and start_session in window_choose_data struct. also add TREE_OTHER define and reorder the struct - rename window_choose_ctx to window_choose_data_run - don't pass a cmd_ctx into window_choose_create (will let it use a different client later). instead take type, session, client - add window_choose_data_free and use it to dispose of wcd rather than each cmd-*.c doing it individually - change so ref counting is done by wcd_add and wcd_free rather than callers - also add a ref to tree_session - all the callbacks except choose-client and find-window are the same so remove them and add window_choose_default_callback - reorder/rename some other bits and pieces for tidyness
* Use a separate define for each default format template and strip clutternicm2012-08-141-2/+2
| | | | from the choose-tree defaults.
* Make command exec functions return an enum rather than -1/0/1 values andnicm2012-07-111-8/+8
| | | | | | add a new value to mean "leave client running but don't attach" to fix problems with using some commands in a command sequence. Most of the work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
* xfree is not particularly helpful, remove it. From Thomas Adam.nicm2012-07-101-6/+7
|
* Provide common helper function for adding windows and sessions to choosenicm2012-06-251-10/+14
| | | | | lists and expand %% in command before using it rather than at callback time. From Thomas Adam.
* Clean up and simplify the choose mode code, from Thomas Adam.nicm2012-06-251-62/+30
|
* Switch all of the various choose- and list- commands over to the formatnicm2012-05-221-8/+18
| | | | infrastructure, from Thomas Adam.
* Clean up and simplify tmux command argument parsing.nicm2011-01-041-13/+12
| | | | | | | | | | | | | | | | | | | Originally, tmux commands were parsed in the client process into a struct with the command data which was then serialised and sent to the server to be executed. The parsing was later moved into the server (an argv was sent from the client), but the parse step and intermediate struct was kept. This change removes that struct and the separate parse step. Argument parsing and printing is now common to all commands (in arguments.c) with each command left with just an optional check function (to validate the arguments at parse time), the exec function and a function to set up any key bindings (renamed from the old init function). This is overall more simple and consistent. There should be no changes to any commands behaviour or syntax although as this touches every command please watch for any unexpected changes.
* Remove unused variable.nicm2011-01-011-3/+1
|
* Change from a per-session stack of buffers to one global stack which isnicm2010-12-301-3/+3
| | | | | | | much more convenient and also simplifies lot of code. This renders copy-buffer useless and makes buffer-limit now a server option. By Tiago Cunha.
* Add a choose-buffer command for easier use of the paste buffer stack.nicm2010-06-211-0/+146