Commit Graph

35 Commits

Author SHA1 Message Date
Tiago Cunha
a0b2b8e875 Sync OpenBSD patchset 547:
Cleanup by moving various (mostly horrible) little bits handling UTF-8 grid
data into functions in a new file, grid-utf8.c, and use sizeof intead of
UTF8_DATA.

Also nuke trailing whitespace from tmux.1, reminded by jmc.
2009-11-19 22:23:27 +00:00
Tiago Cunha
3d88da7b2a Sync OpenBSD patchset 409:
Move lines into the history when scrolling even if the scroll region is not
the entire screen.

Allows ircII users to see history, prompted by naddy.
2009-10-15 01:55:12 +00:00
Tiago Cunha
c507bf25de Sync OpenBSD patchset 328:
Stick line length to what is actually used (removing an optimization that
allowed it to be bigger), and use clear line/EOL sequences rather than spaces
in copy/scroll mode.

This fixes xterm copy/paste from tmux which treats trailing spaces differently
from clearing a line with the escape sequences. Reported by martynas@.
2009-09-15 23:54:57 +00:00
Tiago Cunha
a004fc3592 Sync OpenBSD patchset 283:
Fix grid_expand_line so it actually works when the required size is bigger than
2 * the current size.
2009-08-21 21:10:37 +00:00
Tiago Cunha
4b883524d8 Sync OpenBSD patchset 282:
A few trivial optimisations: no need to check for zero size if calling
buffer_ensure in buffer.c; expand grid lines by a greater increase than one
each time; and don't read UTF-8 data unless it actually needs to be checked
when overwriting a cell.
2009-08-21 21:09:13 +00:00
Tiago Cunha
e8ea3ccd58 Sync OpenBSD patchset 239:
Use the right source and destination lines in grid_duplicate_lines.
2009-08-10 21:40:21 +00:00
Tiago Cunha
37b0bcd7c1 Sync OpenBSD patchset 226:
Change the way the grid is stored, previously it was:

- a two-dimensional array of cells;
- a two-dimensional array of utf8 data;
- an array of line lengths.

Now it is a single array of a new struct grid_line each of which represents a
line and contains the length and an array of cells and an array of utf8 data.

This will make it easier to add additional per-line members, such as flags.
2009-08-09 17:28:24 +00:00
Tiago Cunha
6a97901691 Sync OpenBSD patchset 153:
Remove a couple of unused functions and fix a type ("FALLTHOUGH"), found by
lint.
2009-07-22 17:31:20 +00:00
Nicholas Marriott
946affe60d Stupid cvsps. 2009-07-17 12:35:01 +00:00
Nicholas Marriott
ede2dd2d3a Typo in grid_duplicate_lines (sy for dy) causing it to write into the wrong
place when copying UTF-8 data. Found by Dan Colish.
2009-07-17 07:45:08 +00:00
Nicholas Marriott
d956ed0760 Typo in grid_duplicate_lines (sy for dy) causing it to write into the wrong
place when copying UTF-8 data. Found by Dan Colish.
2009-07-16 07:35:35 +00:00
Nicholas Marriott
e63567d51c Support "alternate screen" mode (terminfo smcup/rmcup) typically used by full
screen interactive programs to preserve the screen contents. When activated, it
saves a copy of the visible grid and disables scrolling into and resizing out
of the history; when deactivated the visible data is restored and the history
reenabled.
2009-07-14 06:40:33 +00:00
Nicholas Marriott
d2c3dbc665 If it exist, load a system-wide configuration file /etc/tmux.conf before any
user-specified one.
2009-07-14 06:38:14 +00:00
Nicholas Marriott
3fb3613d34 Limit the history to hlimit not hlimit - 1. This makes a history-limit setting
of 0 work as expected.
2009-07-12 17:12:41 +00:00
Nicholas Marriott
bb459beb03 Whitespace and more syncing. 2009-06-25 16:34:50 +00:00
Nicholas Marriott
a5830b9603 Restore $Id$ and add script to do so. 2009-06-25 16:21:32 +00:00
Nicholas Marriott
582660bdf3 Miscellaneous unused functions, including one which was basically a
duplicate. Found by lint.
2009-06-25 16:09:11 +00:00
Nicholas Marriott
f7a9eb46fc Change find-window and monitor-content to use fnmatch(3). For convenience and
compatibility, *s are implicitly added at the start and end of the pattern.
2009-06-25 16:04:24 +00:00
Nicholas Marriott
853ad68162 Add a dedicated function to convert a line into a string and use it to simplify the search window function. 2009-06-25 16:02:37 +00:00
Nicholas Marriott
143aa718e5 Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
Nicholas Marriott
6fdac02b53 Add UTF-8 to grid_compare.. 2009-03-30 19:44:55 +00:00
Nicholas Marriott
cf7b384c43 Better UTF-8 support, including combined characters. Unicode data is now stored
as UTF-8 in a separate array, the code does a lookup into this every time it
gets to a UTF-8 cell. Zero width characters are just appended onto the UTF-8
data for the previous cell. This also means that almost no bytes extra are
wasted non-Unicode data (yay).

Still some oddities, such as copy mode skips over wide characters in a strange
way, and the code could do with some tidying.
2009-03-28 20:17:29 +00:00
Nicholas Marriott
34dd72f008 _fill functions are no longer needed. Nuke them. 2009-03-28 16:57:03 +00:00
Nicholas Marriott
abf170d6d0 Whoops. Missed a few changes. 2009-03-28 16:55:46 +00:00
Nicholas Marriott
6c0728fe07 Step 2 of the Grand Plan To Make UTF-8 Better.
Split grid into two arrays, one containing grid attributes/flags/colours (keeps
the name grid_cell for now) and a separate with the character data (called
text). The text is stored as a u_short but is treated as a uint64_t elsewhere;
eventually the grid will have two arrays.

I'm not happy with the naming so that might change.

Still need to decide where to go from here. I'm not sure whether to combine
the peek/set functions together, and also whether to continue to treat the
text as a uint64_t (and convert to/from Unicode) or make it a char array
(of size one when UTF-8 disabled, eight when enabled) and keep everything
as UTF-8.

Also since UTF-8 will eventually become an attribute of the grid itself it
might be nice to move all the padding crap into grid.c.
2009-03-28 16:30:05 +00:00
Nicholas Marriott
989d67ccd7 struct grid_data -> struct grid. Stage 1 of the Grand Plan To Make UTF-8 Better. 2009-03-28 15:43:41 +00:00
Nicholas Marriott
a4f5d127e2 Don't leak top line of history and status screen. 2009-02-16 18:51:39 +00:00
Nicholas Marriott
b37399304f Don't redraw status line unless it has actually changed. Stops extraneous
updates between clock/#() changes and doesn't require manual status-interval 0
when no updates are occuring.
2009-02-10 00:18:06 +00:00
Nicholas Marriott
0e197b417a Tidy a few warnings. 2009-01-17 18:47:37 +00:00
Nicholas Marriott
9e56f53895 Correct comment. 2009-01-11 02:23:52 +00:00
Nicholas Marriott
a1b43faa43 Trim spaces. 2009-01-10 01:51:22 +00:00
Nicholas Marriott
10c4a6dc33 Don't die when out of bounds if non-DEBUG. Stops people hitting me when bugs kill their long-running sessions in release versions. 2009-01-08 21:52:05 +00:00
Nicholas Marriott
631a45ecb5 Calculate y properly. 2008-09-28 20:34:22 +00:00
Nicholas Marriott
62457bce0b Trim. 2008-09-26 06:45:28 +00:00
Nicholas Marriott
efe557313a Internal screen data rewrite for better 256 colour/UTF-8 support. 2008-09-25 20:08:57 +00:00