432 Commits (457969381869f9f3ecbb462bf40f053f2a748a02)

Author SHA1 Message Date
Eon S. Jeon 347a45c352 Fix signess of tdefcolor
tdefcolor() returns -1 on error, while its return type is
unsigned long. At the same time, line 1724 and 1731 are checking the
positivity of its unsigned return value.
11 years ago
Alexander Sedov 22eeda56b7 Fixed memory leak in xsettitle(). 11 years ago
Michael Forney 86c03ddc82 Fix blink mode check
ATTR_BLINK is an attribute for a Glyph and will not be set in term.mode.
11 years ago
Eric Pruitt 7e3cff33ff Use character size scaling factors
The bounding boxes for characters can be scaled using "cwscale" and "chscale"
to scale the width and height respectively.
11 years ago
Roberto E. Vargas Caballero aaee0e8b28 Reload colors in reset
Colors definition can be changed using a OSC sequence, so
we have to reload them if we want be sure all the colors
are the correct.

Could be desirable free the colors allocated due to rgb
colors and inverse colors (XftColorAllocValues in xdraws),
but it is impossible due we use the same structure for all
of them.
11 years ago
Roberto E. Vargas Caballero 8dde8cde41 Add RGB color definition
This patch uses the bit 24 in the color descriptor as an indicator
of RGB color, so we can take the values and generating the XftColour
directly in xdraws.
11 years ago
Eon S. Jeon 33ad83d492 Improved font caching
I made a patch that improves the performance of font caching mechanism.
This is based on a funny behaviour of FontConfig: it was handling
FcCharSet in a somewhat unexpected way.

So, we are currently adding "a character" to a new FcCharSet, and then
add it to a FcPattern. However, if we toss the FcPattern to FontConfig,
it loads the entire language(charset) that contains the character we
gave. That is, we don't always have to load a new font for each unknown
character. Instead, we can reused cached fonts, and this significantly
reduces the number of calls to extremely slow FontConfig matching
functions.

One more thing. I found that, in libXft, there's a function called
XftCharExists. XftCharIndex internally calls this function, and
does more stuffs if the character does exist. Since the returned index
is never used in st, we should call XftCharExists instead of
XftCharIndex. Please note that I already made this change in the patch.
11 years ago
Markus Teich 40e4d76d22 fix: whitespace 12 years ago
Alexander Sedov fbc589d506 Remove long text being cropped/wrapped to standard 80x24 on launch.
To be more specific, now tty creation is delayed until X window is
actually mapped; last ConfigureNotify before mapping determines
initial tty size.
Please report problems if there are any.
12 years ago
Markus Teich 6fc471ccc6 fix: consistent usage of bitmask operations on unicode functions 12 years ago
Markus Teich 8b602a37a6 fix: do not need an extra variable for a single read 12 years ago
Roberto E. Vargas Caballero 6e1c7c8afc Fix match function bugs
There were two problems with match denfinition.

1) There was a forward declaration in the form:

	static inline bool match(uint, uint);

but later the function was defined as:

	inline bool
	match(uint mask, uint state) {

This causes that there were two different functions in the code, one local
and inline, and other inline but extern. All was working without problems
due to we were using -Os, and the compiler was using the extern definition
and it was no expanding the static declaration. If you removed the -Os flag,
then you got linker errors due it was no able to find the static definition
of the static declaration.

2) The mask checking was incorrect because we were doing the test:

	(state & mask) != state

and this test only was saying that at least all the enabled bits of state
were enabled also in mask, but no all the possible bits in mask. This was
the origin of the bug reported by Xavier Cartron, where he said it was
possible activated some shortcuts with some of the modifiers defined in the
config.h file.
12 years ago
Roberto E. Vargas Caballero 90c6f055b6 Remove unneded call to draw
draw is the function which update the Xwindow with the information st has,
and it is designed in a way that it must be called once in the main loop
(run function), and calling it in other places it is a waste of time.
12 years ago
Roberto E. Vargas Caballero ebbac77d74 Fix selection clearing
The way st knows if there is a selection activated is checking if sel.ob.x
is equal to -1. In some parts of the code the way of disabling the selection
was only setting it to -1, but after it you can't be sure if the selection
is clearing from the terminal representation, because it is necessary mark
all the lines affected by the selection as dirty. Already there is a functon
which perform this task, selclear.
12 years ago
Christoph Lohmann 5d3318c0c7 Fixing title setting with the title argument. 12 years ago
Christoph Lohmann 369734c80c Adding xterm behaviour to setting the title.
Thanks Airwave!
12 years ago
Christoph Lohmann 7530694987 Adding true mouse motion support. 12 years ago
Christoph Lohmann d743b93fda This is a shorter bit handling in MODE_MOUSE. 12 years ago
Christoph Lohmann 317b785921 Add some comments about the other mouse reporting modes. 12 years ago
Christoph Lohmann 405fd89ac1 Implementing mouse focus and all events. 12 years ago
Christoph Lohmann 8315dc4179 Fixing bad highlighting on first SNAP_WORD multiline select. 12 years ago
Christoph Lohmann b5144100a5 Fixing the selection in a single line again.
Thanks p37sitdu@lavabit.com!
12 years ago
Christoph Lohmann 8f1bef0502 Fixing the selection scrolling and the selection naming.
Thanks p37sitdu@lavabit.com!
12 years ago
Christoph Lohmann 8f47c4a4de Lazy font unloading too. 12 years ago
Christoph Lohmann 62502a88e9 Lazy fontset loading.
Thanks Johannes Hofmann <Johannes.Hofmann@gmx.de>!
12 years ago
Christoph Lohmann 678eff6e18 Removing an old select() regression. 12 years ago
Christoph Lohmann 8e968739c3 Allow more complex delimiters for word selections.
Thanks Alexander Rezinsky <alexrez@gmail.com>!
12 years ago
Christoph Lohmann 0c2b513d01 Expand the last line with '\n' in case of overselection.
Thanks Alexander Rezinsky <alexrez@gmail.com>!
12 years ago
Christoph Lohmann 634c247fa7 Select to the end of row if end of line is reached.
Thanks Alexander Rezinsky <alexrez@gmail.com>!
12 years ago
Christoph Lohmann 5938fa9d32 Better comments for the snapping code. 12 years ago
Christoph Lohmann 8618386de9 More stable blinking. 12 years ago
Christoph Lohmann 911ba5674b Selection snapping is now considering wrapping.
Thanks Alexander Rezinsky <alexrez@gmail.com> for mentioning this!
12 years ago
Christoph Lohmann a53017c8b4 Add a possibility to modify the string sent by mouse buttons.
Thanks Alexander Rezinsky <alexrez@gmail.com> for the suggestion!
12 years ago
Christoph Lohmann a77b01176a Be more efficient in blinking. 12 years ago
Christoph Lohmann 1e09726518 Enable blinking in st. 12 years ago
Christoph Lohmann 1b2751f5c2 Fixing the selection handling to allow one char selection.
Thanks Alexander Sedov <alex0player@gmail.com> for suggesting the fix!
12 years ago
Christoph Lohmann 0851f2be2a Fixing the selection issue in altscreens. 12 years ago
Alexander Sedov 011c0f9e5b Removed redundant check in draw code.
We're now clearing empty areas with spaces, so there is no point to check
if character contains non-empty string.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
12 years ago
Roberto E. Vargas Caballero 048c54fd5b Fix selecting clearing and BCE
The commit b78c5085f7 changed the st behaviour enabling BCE capability,
that means erase regions using background color. Problem comes when you
clear a region with a selection, because in this case the real mode of the
Glyph is not the value of term.line[y][x], due in drawregion we had enabled
the ATTR_REVERSE bit.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
12 years ago
Christoph Lohmann 6b03bb769a Now clipping is more clear. 12 years ago
Christoph Lohmann db6f796ecf Removing the overdrawing of some fonts. 12 years ago
Christoph Lohmann 2bd6afd1c9 Implementing 8 bit mode for meta. 12 years ago
Christoph Lohmann b596d6ba3c Adding wrap handling in selection. 12 years ago
Alexander Sedov 872a7f18ea Added support for double/triple click+dragging.
Now double-click+dragging automatically snaps both ends to word boundaries
(unless on series of spaces), and triple-click selects whole lines.
As a side effect, snapping now occurs on button press, not button release
like it previously was, but I hope that won't be inconvenient for anyone.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
12 years ago
Alexander Sedov e5ff746430 Selection now handles empty lines less counter-intuitively.
Now, when you are selecting a region, you will get all empty lines that happen
to be in it, including trailing ones. Last line terminator is omitted as it previously
was, though.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
12 years ago
Christoph Lohmann da182612b7 Removing trailing whitespace. 12 years ago
Alexander Sedov b7e6a5c825 Got rid of redundant Glyph state.
Now, newly allocated Glyphs are set to spaces and current cursor colors
with tclearregion() routine.

Signed-off-by: Christoph Lohmann <20h@r-36.net>
12 years ago
Christoph Lohmann 3ae0299064 Removing unneeded comments. 12 years ago
Alexander Sedov fed9968ba5 Got rid of code duplication in tnew() and tresize().
Signed-off-by: Christoph Lohmann <20h@r-36.net>
12 years ago
Alexander Sedov 0ca0dd8b11 Strip trailing spaces from lines when copying selection.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
12 years ago