Skip to content
GitLab
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
787787ed
Commit
787787ed
authored
Feb 08, 2010
by
hjk
Browse files
fakevim: fix shift left in visual mode
parent
eb60cf1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
787787ed
...
...
@@ -2669,19 +2669,17 @@ void FakeVimHandler::Private::shiftRegionLeft(int repeat)
int
endLine
=
lineForPosition
(
position
());
if
(
beginLine
>
endLine
)
qSwap
(
beginLine
,
endLine
);
int
shift
=
config
(
ConfigShiftWidth
).
toInt
()
*
repeat
;
int
tab
=
config
(
ConfigTabStop
).
toInt
();
int
firstPos
=
firstPositionInLine
(
beginLine
);
const
int
shift
=
config
(
ConfigShiftWidth
).
toInt
()
*
repeat
;
const
int
tab
=
config
(
ConfigTabStop
).
toInt
();
const
int
firstPos
=
firstPositionInLine
(
beginLine
);
beginEditBlock
(
firstPos
);
for
(
int
line
=
begin
Line
;
line
<
=
end
Line
;
++
line
)
{
for
(
int
line
=
end
Line
;
line
>
=
begin
Line
;
--
line
)
{
int
pos
=
firstPositionInLine
(
line
);
setPosition
(
pos
);
setAnchor
(
pos
);
QString
text
=
m_tc
.
block
().
text
();
const
QString
text
=
lineContents
(
line
);
int
amount
=
0
;
int
i
=
0
;
for
(;
i
<
text
.
size
()
&&
amount
<
=
shift
;
++
i
)
{
for
(;
i
<
text
.
size
()
&&
amount
<
shift
;
++
i
)
{
if
(
text
.
at
(
i
)
==
' '
)
amount
++
;
else
if
(
text
.
at
(
i
)
==
'\t'
)
...
...
@@ -2689,9 +2687,7 @@ void FakeVimHandler::Private::shiftRegionLeft(int repeat)
else
break
;
}
setPosition
(
pos
+
i
);
text
=
selectedText
();
removeSelectedText
();
removeText
(
Range
(
pos
,
pos
+
i
));
setPosition
(
pos
);
}
endEditBlock
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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