Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
3b182fa1
Commit
3b182fa1
authored
Nov 17, 2020
by
Carlos Alves
Committed by
Tomaz Canabrava
Dec 31, 2020
Browse files
Change a specific position at history
Needed to correct the history when columns size change
parent
155cedec
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/history/HistoryScroll.h
View file @
3b182fa1
...
...
@@ -47,6 +47,10 @@ public:
virtual
void
addLine
(
bool
previousWrapped
=
false
)
=
0
;
// modify history
virtual
void
setCellsVectorAt
(
int
position
,
const
QVector
<
Character
>
&
cells
)
=
0
;
virtual
void
setLineAt
(
int
position
,
bool
previousWrapped
)
=
0
;
//
// FIXME: Passing around constant references to HistoryType instances
// is very unsafe, because those references will no longer
...
...
src/history/HistoryScrollFile.cpp
View file @
3b182fa1
...
...
@@ -79,3 +79,11 @@ void HistoryScrollFile::addLine(bool previousWrapped)
unsigned
char
flags
=
previousWrapped
?
0x01
:
0x00
;
_lineflags
.
add
(
reinterpret_cast
<
char
*>
(
&
flags
),
sizeof
(
char
));
}
void
HistoryScrollFile
::
setCellsVectorAt
(
int
,
const
QVector
<
Character
>
&
)
{
}
void
HistoryScrollFile
::
setLineAt
(
int
,
bool
)
{
}
src/history/HistoryScrollFile.h
View file @
3b182fa1
...
...
@@ -34,6 +34,9 @@ public:
void
addCells
(
const
Character
text
[],
int
count
)
override
;
void
addLine
(
bool
previousWrapped
=
false
)
override
;
void
setCellsVectorAt
(
int
position
,
const
QVector
<
Character
>
&
cells
)
override
;
void
setLineAt
(
int
position
,
bool
previousWrapped
)
override
;
private:
qint64
startOfLine
(
int
lineno
);
...
...
src/history/HistoryScrollNone.cpp
View file @
3b182fa1
...
...
@@ -51,3 +51,11 @@ void HistoryScrollNone::addCells(const Character [], int)
void
HistoryScrollNone
::
addLine
(
bool
)
{
}
void
HistoryScrollNone
::
setCellsVectorAt
(
int
,
const
QVector
<
Character
>
&
)
{
}
void
HistoryScrollNone
::
setLineAt
(
int
,
bool
)
{
}
\ No newline at end of file
src/history/HistoryScrollNone.h
View file @
3b182fa1
...
...
@@ -32,6 +32,9 @@ public:
void
addCells
(
const
Character
a
[],
int
count
)
override
;
void
addLine
(
bool
previousWrapped
=
false
)
override
;
void
setCellsVectorAt
(
int
position
,
const
QVector
<
Character
>
&
cells
)
override
;
void
setLineAt
(
int
position
,
bool
previousWrapped
)
override
;
};
}
...
...
src/history/compact/CompactHistoryScroll.cpp
View file @
3b182fa1
...
...
@@ -91,6 +91,21 @@ void CompactHistoryScroll::setMaxNbLines(unsigned int lineCount)
////qDebug() << "set max lines to: " << _maxLineCount;
}
void
CompactHistoryScroll
::
setCellsVectorAt
(
int
position
,
const
TextLine
&
cells
)
{
CompactHistoryLine
*
line
=
new
(
_blockList
)
CompactHistoryLine
(
cells
,
_blockList
);
delete
_lines
.
takeAt
(
position
);
_lines
.
insert
(
position
,
line
);
}
void
CompactHistoryScroll
::
setLineAt
(
int
position
,
bool
previousWrapped
)
{
CompactHistoryLine
*
line
=
_lines
.
at
(
position
);
line
->
setWrapped
(
previousWrapped
);
}
bool
CompactHistoryScroll
::
isWrappedLine
(
int
lineNumber
)
{
Q_ASSERT
(
lineNumber
<
_lines
.
size
());
...
...
src/history/compact/CompactHistoryScroll.h
View file @
3b182fa1
...
...
@@ -33,6 +33,8 @@ public:
void
addLine
(
bool
previousWrapped
=
false
)
override
;
void
setMaxNbLines
(
unsigned
int
lineCount
);
void
setCellsVectorAt
(
int
position
,
const
TextLine
&
cells
)
override
;
void
setLineAt
(
int
position
,
bool
previousWrapped
)
override
;
private:
bool
hasDifferentColors
(
const
TextLine
&
line
)
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment