Commit Graph

6467 Commits

Author SHA1 Message Date
nicm
4d9e6ea310 Some improvements and bug fixes for hooks:
- Prepare the state again before the "after" hooks are run, because the
  command may have killed or moved windows.

- Use the hooks list from the newly prepared target, not the old hooks
  list (only matters for new-session really).

- Correctly detect an invalid current state and ignore it in
  cmd_find_target ("killw; swapw").

- Change neww, new, killp, killw, splitw, swapp, swapw to update the
  current state (used if no explicit target is given) to something more
  useful after they have finished. For example, neww changes it to the
  newly created window.

Hooks are still relatively new and primitive so there are likely to be
more changes to come.

Parts based on bug reports from Uwe Werler and Iblis Lin.
2016-10-13 10:01:49 +00:00
nicm
05dac2e42c -f missed from splitw usage, from Felix Rosencrantz. 2016-10-13 09:06:48 +00:00
Thomas Adam
6551f4bb3b Merge branch 'obsd-master'
Conflicts:
	paste.c
2016-10-13 08:09:47 +01:00
nicm
e0add119ea Compare to see if pane status line has actually changed, not just size, and
do not draw if pane is not visible.
2016-10-12 17:36:52 +00:00
nicm
e83ebf50de Fix a couple of problems with insert mode: flush dirty cells before we
modify the screen, not after; and use grid_view_insert_cells to make
space not grid_move_cells.
2016-10-12 15:43:51 +00:00
nicm
40253048ca bind-key -c has gone, remove from man page, and unused table declarations. 2016-10-12 15:26:37 +00:00
nicm
c484c5a2a1 Drop the edit mode key tables and just use fixed key bindings for the
command prompt.
2016-10-12 14:50:14 +00:00
nicm
4160df4ca4 Redraw selection in tty_draw_line, so it appears when redrawing whole
pane. Reported by Theo Buehler.
2016-10-12 13:24:07 +00:00
nicm
68bebe1fb7 The repeat prompt in both emacs and vi (and the old one in tmux) doesn't
support line editing and instead executes a command as soon as a
non-number key is pressed. Add a -N flag to command-prompt for the same
in copy mode. Reported by Theo Buehler.
2016-10-12 13:03:27 +00:00
Nicholas Marriott
76a9e6f27b NetBSD needs _OPENBSD_SOURCE for reallocarray. 2016-10-12 10:52:04 +01:00
nicm
22a8afee9e Unused variable and missing time.h. 2016-10-12 09:07:58 +00:00
Thomas Adam
12efb40dc5 Linux: #include <time.h> for time() 2016-10-12 09:53:30 +01:00
Thomas Adam
0f7d39c410 Add missing function protype 2016-10-12 09:49:16 +01:00
Thomas Adam
b9dc855016 Merge branch 'obsd-master'
Conflicts:
	format.c
	osdep-openbsd.c
2016-10-12 09:45:49 +01:00
nicm
5c49e1d0c1 Some other stuff that can be local to one file. 2016-10-11 13:45:47 +00:00
nicm
e45401846f Add static in window-*.c and move some internal functions out of tmux.h. 2016-10-11 13:21:59 +00:00
nicm
85d7afaefc Support double and triple clicks (they are cumulative, so double is
fired then triple), and use for select-word and select-line in copy
mode. Inspired by a different solution from Omar Sandoval.
2016-10-11 09:30:36 +00:00
nicm
76d6d3641f Fundamental change to how copy mode key bindings work:
The vi-copy and emacs-copy mode key tables are gone, and instead copy
mode commands are bound in one of two normal key tables ("copy-mode" or
"copy-mode-vi"). Keys are bound to "send-keys -X copy-mode-command". So:

    bind -temacs-copy C-Up scroll-up
    bind -temacs-copy -R5 WheelUpPane scroll-up

Becomes:

    bind -Tcopy-mode C-Up send -X scroll-up
    bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up

This allows the full command parser and command set to be used - for
example, we can use the normal command prompt for searching, jumping,
and so on instead of a custom one:

    bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward '%%'"

command-prompt also gets a -1 option to only require on key press, which
is needed for jumping.

The plan is to get rid of mode keys entirely, so more to come eventually.
2016-10-11 07:23:34 +00:00
nicm
8b804fb589 Support UTF-8 entry into the command prompt. 2016-10-11 07:11:40 +00:00
nicm
a81685bfac Add static in cmd-* and fix a few other nits. 2016-10-10 21:51:39 +00:00
nicm
c426e485e5 Loads more static, except for cmd-*.c and window-*.c. 2016-10-10 21:29:23 +00:00
Thomas Adam
27126f8797 Merge branch 'obsd-master' 2016-10-10 20:01:11 +01:00
nicm
66b5477cc1 Do not allow the opposite pane to resize when dragging with the mouse
because it is not possible to keep the mouse on the border when the
minimum size is reached.
2016-10-10 17:28:30 +00:00
Thomas Adam
226b6a2192 Merge branch 'obsd-master' 2016-10-10 16:01:12 +01:00
nicm
7d4b416fe6 Some more static. 2016-10-10 13:54:47 +00:00
Thomas Adam
215d3f8c0d Merge branch 'obsd-master' 2016-10-09 18:01:10 +01:00
nicm
b8f2dd8237 Make the CLIENT_STATUS flag imply that pane status lines are redrawn if
they are enabled and break the actual screen generation code into a
separate function. Fixes problems reported by Romain Francoise.
2016-10-09 16:24:34 +00:00
Thomas Adam
526e860a7a Merge branch 'obsd-master' 2016-10-09 10:01:12 +01:00
nicm
1db6d6fea6 Pass file/line to new command for if-shell so that errors appear
sensibly.
2016-10-09 08:06:51 +00:00
nicm
48dd250af1 Handle NULL window or session for user options. 2016-10-09 07:58:35 +00:00
nicm
44449b305b Use xsnprintf not snprintf for the prompt in window_copy_write_line
because we don't care if it is truncated to the screen width, we don't
want it to be fatal.
2016-10-09 07:30:28 +00:00
Thomas Adam
fb0b2cd37a Merge branch 'obsd-master' 2016-10-06 00:01:11 +01:00
nicm
30086e504c screen_write_copy tried to be clever and clear the line if it reached
the end of the source, but it was wrong and causes problems that are
only showing up now we are more aggressive about skipping redundant
screen updates. Remove the optimization entirely as more trouble than it
is worth to fix (and it'll have to go when BCE is done anyway).
2016-10-05 22:00:29 +00:00
Thomas Adam
5b8f033e06 Merge branch 'obsd-master' 2016-10-05 14:01:10 +01:00
nicm
f55c991a1b Wrap some long lines in screen-write.c. 2016-10-05 12:36:36 +00:00
nicm
4117a7ed19 Keep buffer creation time and add accessors for it and the order number. 2016-10-05 12:34:05 +00:00
nicm
b4f95c43fc Allow cmd_mouse_at return arguments to be NULL. 2016-10-05 12:32:13 +00:00
Thomas Adam
4740ecbeae Merge branch 'obsd-master' 2016-10-04 02:01:11 +01:00
Thomas Adam
ddfed259f6 Merge branch 'obsd-master' 2016-10-04 00:01:11 +01:00
nicm
1b31d148c9 Remove some dead code in cmd-move-window.c and make a load of local
functions static.
2016-10-03 22:52:11 +00:00
Thomas Adam
6943fbbb81 Merge branch 'obsd-master' 2016-10-03 22:01:12 +01:00
nicm
305c832a97 Document set-hook -u. 2016-10-03 20:58:39 +00:00
nicm
61dfbe702e Remove some redundant checks and make ich/dch consistent. 2016-10-03 19:19:18 +00:00
Thomas Adam
23254f59da Fix typos 2016-09-30 09:50:40 +01:00
Thomas Adam
bb7cc8e8fd Start working on 2.4 2016-09-29 22:00:00 +01:00
Thomas Adam
52869ed182 Release tmux 2.3 2016-09-29 21:54:12 +01:00
Thomas Adam
19104d592b Merge branch 'obsd-master' 2016-09-29 12:01:11 +01:00
nicm
cf7f3a436a Check padding when writing any character with width > 1, in case they
overlap after the first character (for example with cells xy and ab, y
is replacing a).
2016-09-29 08:50:43 +00:00
Thomas Adam
c41916ee16 Merge branch 'obsd-master' 2016-09-28 18:01:11 +01:00
nicm
bb5798aa0e Couple of vasprintf -> xvasprintf. 2016-09-28 14:40:07 +00:00