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
Marco Bubke
flatpak-qt-creator
Commits
e64c255b
Commit
e64c255b
authored
Dec 21, 2009
by
Roopesh Chander
Committed by
Thorbjørn Lindeijer
Feb 08, 2010
Browse files
fix crash on files with no indented lines
parent
d330320f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/texteditor/tabsettings.cpp
View file @
e64c255b
...
@@ -234,8 +234,10 @@ bool TabSettings::guessSpacesForTabs(const QTextBlock& _block) const {
...
@@ -234,8 +234,10 @@ bool TabSettings::guessSpacesForTabs(const QTextBlock& _block) const {
QVector
<
QTextBlock
>
currentBlocks
(
2
,
_block
);
// [0] looks back; [1] looks forward
QVector
<
QTextBlock
>
currentBlocks
(
2
,
_block
);
// [0] looks back; [1] looks forward
int
maxLookAround
=
100
;
int
maxLookAround
=
100
;
while
(
maxLookAround
--
>
0
)
{
while
(
maxLookAround
--
>
0
)
{
currentBlocks
[
0
]
=
currentBlocks
.
at
(
0
).
previous
();
if
(
currentBlocks
.
at
(
0
).
isValid
())
currentBlocks
[
1
]
=
currentBlocks
.
at
(
1
).
next
();
currentBlocks
[
0
]
=
currentBlocks
.
at
(
0
).
previous
();
if
(
currentBlocks
.
at
(
1
).
isValid
())
currentBlocks
[
1
]
=
currentBlocks
.
at
(
1
).
next
();
bool
done
=
true
;
bool
done
=
true
;
foreach
(
QTextBlock
block
,
currentBlocks
)
{
foreach
(
QTextBlock
block
,
currentBlocks
)
{
if
(
block
.
isValid
())
if
(
block
.
isValid
())
...
...
Write
Preview
Markdown
is supported
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