Where it was possible:
- 'For' to STL copy or fill (it is like using memcpy and memset, faster
than for, the compiler decides the best algo to perform the task);
- 'For' + 'if' to 'where', it is faster and cleanner to read.
Changes in: PlainTextDecoder.cpp, HTMLDecoder.cpp, ColorScheme.cpp and
ExtendedCharTable.cpp
Where it was possible:
- 'For' to STL copy or fill (it is like using memcpy and memset, faster
than for, the compiler decides the best algo to perform the task);
- qMin(qMax) to qBound.
Changes in: TeminalDisplay and TerminalColor
Unlimited to Fixed Size must have the fixed size information preserved.
Fixed Size to Unlimited must have all the information preserved.
All types to None all information must be erased.
While testing I found a bug in CompactHistoryScroll add function, it
should append before check the vector size and not after, it was
returning a Size > Max Size, not equal.
Another Bug found in fixed size history scroll, it was not properly
reflowing the last line, a position problem when adding and removing
lines to keep a fixed size.
Moving the fixed size history reflow code to compactHistoryScroll file.
Screen file will not handle history reflow, unlimited scroll is
completely different from fixed size scroll reflow.
QMimeDataBase will return "application/octet-stream" as the mime type
of something like "path/to/some/textfile.txt:123:123:", because we are
using methods from it that check only the file extension. That meant
some valid text files with line/column suffixes couldn't be opened.
Instead move the mime type check _after_ the file path has been cleaned.
Also account for mime types that aren't recognized, e.g. a text file with
no extension.
BUG: 431601
When this feature is turned off, it deletes some keys from Konsole's
config file. However this broke recently for two reasons:
1. The key names changed a few Frameworks releases ago
2. There are new keys that need to be deleted or else position gets
restored too
This commit fixes that bug by updating the condition to delete all the
config keys required to make the off state for this feature work again.
BUG: 427610
FIXED-IN: 20.12.2
(cherry picked from commit 8fa1c4b508b080f958a16d52a1e03bcf9e7e4495)
This allows sending signals to work again. Correct macos keytab so
Ctrl+C and Ctrl+V work. Add warning to show sending signals
require foreground process id to be set.
When activating a file filter hot spot, everything got opened with the text
editor specified in the profile settings, which is wrong e.g. with pdf or
png files. Check the mime type of the file path, based only on the extension
so as to keep things fast.
Also rename openWithSysDefaultEditor() to openWithSysDefaultApp(), which is
more accurate.
BUG: 431496
When using unlimited history and change to fixed history size, it will
move, limited by the fixed size, the history.
It will create a new CompactHistoryScroll, get the lines from the old
HistoryScrollFile, and delete the old HistoryScrollFile structure.
It is not reflowing unlimited history lines (there is no limit and it
can be very long), it just reflow screenlines and join the lines when it
get to history.
- Handle `grep -n` output with long lines, where there is no space
after "path/to/file:123:", we can send "path/to/file:123:bla" to
a text editor and it seems most of them just ignore the text after
the last ":"
- If the session pointer is null, there is nothing to do
- Guard against editorCmd not having any spaces in it, which it could
be with the "Custom" entry (from the combobox)
- Even when the file URL doesn't match the /path/to/file:line:column
pattern try to use the editor specified in the profile settings
The functionality to open a file at a certain line/column in a text editor
was added in commit 923f8d144a. Here some preset text editors are added
to make it easier to select your preferred text editor to use; the syntax
for each editor is hard-coded, however there is a "custom" entry in the
combobox where the user can set a different text editor (or a different
syntax).
This combobox is inspired by the "Code Navigation" menu in Heaptrack.
GUI:
Unfortunately the code is still fragile and I froze konsole
a few times in a few minutes. This is something that konsole
really needs, but we need more time to squish all the bugs
we find.
Reflow does not work when columns < 17 and/or lines < 3.
Seems to me there is a conflict of the window pixels size limit, the
columns that it can paint within those limits and the mouse position
when adjusting to the minimal window size.
- Missing properties causing reflow bug.
- _screenLines[0].data() not working as I thoughit would.
TODO:
- Check the bug when columns around less than 25.
- Keep current line and take from _history to _screenLine.
- Check how and if it affects file history.