Commit Graph

321 Commits

Author SHA1 Message Date
Kurt Hindenburg
f667db3eb1 remove unneeded old style cast 2017-12-30 13:14:34 -05:00
Kurt Hindenburg
1e2a70d2bc old style cast -> static_cast 2017-12-30 11:36:51 -05:00
Kurt Hindenburg
2e86be05dc Implement support for trimming leading whitespace
There's already an option for removing trailing whitespace.

Combining both pulls since the later makes the code easier to read.

Patches by sandsmark

Differential Revision: https://phabricator.kde.org/D8381
Differential Revision: https://phabricator.kde.org/D8417
2017-12-25 11:30:35 -05:00
Kurt Hindenburg
2a2a56d73c modernize use nullptr 2017-07-15 23:28:32 -04:00
Kurt Hindenburg
7ff23512fd Correct scrollUp behavior
CSI S escape sequence (SU, scroll up) ignored if number of lines to
scroll bigger than scrollable lines

REVIEW: 130133
BUG: 379318
2017-07-01 19:12:39 -04:00
Kurt Hindenburg
e3458bec2e Remove unused methods
Fixes D6082
2017-06-11 13:07:39 -04:00
Kurt Hindenburg
eade05a4bd Do not specify Qt modules in includes 2017-04-26 21:33:34 -04:00
Kurt Hindenburg
a540e6fdd0 Fix readability-implicit-bool-cast issues using nullptr 2017-04-21 10:51:31 -04:00
Kurt Hindenburg
95fc42bfa9 add FIXME about Q_ASSERT being triggered 2017-04-11 12:21:43 -04:00
Kurt Hindenburg
66044df34b fix a lot of issues of readability-implicit-bool-cast 2017-03-29 08:32:59 -04:00
Kurt Hindenburg
2b586e6ff8 use auto 2017-03-28 11:25:26 -04:00
Kurt Hindenburg
e6fcf3e629 remove unused code since KDE4 2017-03-28 10:21:47 -04:00
Kurt Hindenburg
64962ef25b Correct bool/int usage readability-implicit-bool-cast 2017-03-27 10:02:05 -04:00
Martin T. H. Sandsmark
a593f29e24 Limit ourselves to 3 combining characters
This seems to be the limit in all the test files I've been trying.
Without this we get an issue with too many combining characters where
Konsole will eventually just hang.

REVIEW: 129874
2017-01-22 22:18:13 +01:00
Martin T. H. Sandsmark
62a3893319 Don't include newlines in selection if trimming is on
BUG: 199381
REVIEW: 129837
2017-01-22 20:11:50 +01:00
Martin T. H. Sandsmark
1c13e4841d Handle surrogate utf16 characters
For our own sanity we (falsely) assume that all surrogate characters are
double width, otherwise we have to go back and reflow the line.

This makes it work better with emojis in vim at least.

REVIEW: 129841
2017-01-22 20:09:38 +01:00
Martin T. H. Sandsmark
80b9e0775e Fix crash with combining characters after several cursorRight() calls
cursorRight() does not resize the _screenLines vector, leading to an
assert in QVector when trying to look up the _cuX which is bigger than
the amount of characters in the current line.

BUG: 372530
2016-11-20 14:04:48 +01:00
Kurt Hindenburg
84b43dfb21 Add rendition flags SGRs 2, 8, 9, 53
Adds faint intensity, strikeout, conceal and overline support.

echo -e 'D\e[2mD\e[9mD\e[53mD\e[8mD'

Thanks to Antonio Russo antonio e russo gmail com for patch

REVIEW: 128405
BUG: 362171
2016-07-16 12:34:24 -04:00
Martin T. H. Sandsmark
b8e96bcdca Preserve current line when resetting
Reset was always called with clearScreen = true, so no point in having
that variable. We can probably also remove Screen::clear() and
Screen::home(), they're not used anymore, and weren't really useful
before this either.

We still preserve the scrollback history when resetting, which is not
what other terminal emulators do (http://stackoverflow.com/a/5367075),
but we do have a separate action for it, so I think it is a nice extra
feature to preserve it.

REVIEW: 128389
2016-07-08 01:15:40 +02:00
Martin T. H. Sandsmark
437440978b Fix rendering of decomposed Hangul
When looking backwards to combine into a character, it didn't take into
account characters with two column width. It also assumed that all
characters that needed to be combined were in the Mn unicode character
category, while the Hangul starting consonants are in the Lo category.
2016-07-06 23:00:07 +02:00
Kurt Hindenburg
abb83e8ef0 Add support for copying HTML formatted text from terminal
Currently, only text is supported - this add HTML

Thanks to Anonymous Koavohv koavohv gmail com

REVIEW: 119914
2014-10-04 11:57:54 -04:00
Kurt Hindenburg
427de88cc1 Fix wrong rendering at the end of line when drawing colored whitespaces
Previous code just deleted the end characters; new code puts in spaces
with current attributes at the end of the line.

Thanks to Igor Kostromin elwood.su@gmail.com for bug, research + patch

See bko for test code + more info
BUG: 330214
FIXED-IN: 2.13
2014-02-09 11:02:01 -05:00
Kurt Hindenburg
7937cb9793 Add boundary check in copyLineToStream to try to prevent crashes
A lot of crashes in copyLineToStream _screenLines[screenLine]; this
likely needs to be a container, for now add an extra variable to watch
the size.
I still can't reproduce it though a lot of people can doing various
things.
319888, 313711, 312006, 306939, 304837
2013-05-17 09:12:29 -04:00
Kurt Hindenburg
17de056907 English fixes to comments only 2013-03-17 12:23:05 -04:00
Kurt Hindenburg
7a2a5beb00 Correct spelling errors/word usage
All these are in the comments - no code changes
2013-01-09 22:07:11 -05:00
Kurt Hindenburg
983efbc5a8 Add braces around if/else for readability 2012-12-19 23:41:09 -05:00
Kurt Hindenburg
ca9dd11bf5 Allow option to trim spaces at end of line
In the ongoing issue with spaces at the end of lines, this allows for
an option to trim the spaces.  By default, it is disabled so only
people who need this will be affected.

Many thanks to David Smid <david@smidovi.eu>

CCBUG: 188528
2012-09-09 19:10:41 -04:00
Jekyll Wu
4289c5782a Just a few renames 2012-05-23 18:44:31 +08:00
Kurt Hindenburg
bee9aa8f78 minor style fixes - remove empty lines start/end code blocks 2012-05-13 10:08:05 -04:00
Kurt Hindenburg
5b083640ce whitespace and style fixes
Use 'git diff -w --ignore-all-space' to see non-whitespace changes
2012-04-05 11:08:53 -04:00
Frederik Gladhorn
7e0ba7079a Accessible interface for TerminalDisplay
This allows screen readers to read the output
in the konsole window.
2012-03-29 20:00:35 +02:00
Kurt Hindenburg
e0862c603a Style fixes - separte commands - remove 2 ; - align { elses 2012-03-18 15:57:48 -04:00
Kurt Hindenburg
519e2614d6 Style fixes - remove spaces before ; and add spaces in for loops 2012-03-18 15:11:06 -04:00
Jekyll Wu
25b8b5353c Trivial style change: remove extra blank lines 2012-03-17 19:53:21 +08:00
Jekyll Wu
6dd15d9061 split class ExtenededCharTable into its own file 2012-03-06 04:44:32 +08:00
Jekyll Wu
695c680271 Less unneeded #include 2012-03-05 06:16:54 +08:00
Jekyll Wu
e977062afd Avoid using magic number 2012-03-05 00:37:20 +08:00
Jekyll Wu
01f8d2ce7f Rename member variables 2012-03-05 00:34:48 +08:00
Jekyll Wu
4192031fd5 More constness for better understanding the code 2012-03-04 21:19:33 +08:00
Jekyll Wu
26331fc17c assert ==> Q_ASSERT 2012-03-01 19:30:56 +08:00
Jekyll Wu
f42fd4721b Clean up unneeded #includes 2012-02-20 19:41:38 +08:00
Kurt Hindenburg
30a4fa669e Apply astyle-kdelibs
Over the years, the coding style is all over the place.

Use 'git diff -w --ignore-all-space' to see non-whitespace changes.
2011-12-24 11:13:03 -05:00
Kurt Hindenburg
bc087ae51b Remove unused KDebug includes 2011-12-18 00:01:32 -05:00
Jekyll Wu
72a1adc631 Avoid extra trailing whitespace when copying text
A new 'isRealCharacter' flag is added into the 'Character' class
to distinguish real characters and charaters used as place holders.

The code is a bit ugly now. Should improve it later when the idea and
implementation are proven to be feasible and cause no regression.

CCBUG: 188528
2011-11-26 10:59:08 +08:00
Kurt Hindenburg
0905a301e6 Prevent crashing when dumping binary files to terminal.
"cat"ing binary files often crashes Konsole.  This patch checks the
indicies.
Note that there are tons of 'undecodable sequences' that also print
out.  These likely should not be displayed unless debugging.
BUG: 184964
FIXED-IN: 4.8
2011-11-13 16:21:49 -05:00
Jekyll Wu
125e2c7bd2 Declare pointer and reference in a consistent way
Most code use the "const QString& text" form, instead of the "const
QString &text" form. So change the minority to be consistent with
the majority.
2011-11-06 06:13:28 +08:00
Jekyll Wu
50a07d79da Remove dead method Screen::compose(String) 2011-11-03 06:53:49 +08:00
Jekyll Wu
e825a8e0b6 Prefer forward declaration when it is enough 2011-11-01 13:41:54 +08:00
Jekyll Wu
c84c55d52b Remove inapproriate TODO and useless comment 2011-10-19 04:38:36 +08:00
Jekyll Wu
c001df918c Minor change on constructor 2011-10-19 04:38:36 +08:00