[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: Re: Review Request 117672: vimode: fixed the position of the cursor in visual mode for some cases of
From: "Commit Hook" <null () kde ! org>
Date: 2014-04-21 11:06:28
Message-ID: 20140421110628.3534.44732 () probe ! kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117672/#review56111
-----------------------------------------------------------
This review has been submitted with commit 604ffb53011cbfd15a1bcdb6e27752866ae256c1 \
by Miquel Sabaté to branch master.
- Commit Hook
On April 21, 2014, 10:59 a.m., Miquel Sabaté Solà wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117672/
> -----------------------------------------------------------
>
> (Updated April 21, 2014, 10:59 a.m.)
>
>
> Review request for Kate, Michal Humpula and Simon St James.
>
>
> Repository: kate
>
>
> Description
> -------
>
> This is another item I had on my To Do list regarding visual mode :) Currently Kate \
> crashes in this example (command: "2lvjc"):
> Hello
> World
>
> Note that the applied command will also make Kate crash for an empty document. \
> Anyways, the problem here is that when the user selects a range of text in visual \
> mode from up to down and it presses c, the cursor is placed in the last line. This \
> is not what we want for the following reasons:
> 1. It's a bit unexpected. As an example, perform the "2lvjcX" sequence in this \
> text:
> Hello
> World
> Another
>
> The end results is:
>
> Held
> AnXother
>
> That is, the cursor has been placed in the word "Another", even if this word had \
> nothing to do with the selection.
> 2. It's not only unexpected, it's wrong :) In my previous example, the cursor is \
> placed in "Another". This is because "2lvj" selected the first two lines. However, \
> when the user presses "c", the first two commands have to be joined, and, \
> therefore, now in the second line we have another word. So, what I'm trying to say, \
> the current behavior doesn't work when we hit a command that has to remove end of \
> line characters.
> As I said previously, all of these things happen when we select a range of text \
> from up to down (the line where we started the selection is on top of the line \
> where we ended the selection). However, this doesn't happen when we do from down to \
> up. That's why in this patch I only focus on this case (m_commandRange.startLine < \
> m_commandRange.endLine).
>
> Diffs
> -----
>
> part/vimode/katevinormalmode.cpp 232b38d
> tests/vimode_test.cpp 407641d
>
> Diff: https://git.reviewboard.kde.org/r/117672/diff/
>
>
> Testing
> -------
>
> All tests are passing. I've also added a couple of tests for this.
>
>
> Thanks,
>
> Miquel SabatĂ© SolĂ
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/117672/">https://git.reviewboard.kde.org/r/117672/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This review has been \
submitted with commit 604ffb53011cbfd15a1bcdb6e27752866ae256c1 by Miquel Sabaté to \
branch master.</pre> <br />
<p>- Commit Hook</p>
<br />
<p>On April 21st, 2014, 10:59 a.m. UTC, Miquel Sabaté Solà wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Kate, Michal Humpula and Simon St James.</div>
<div>By Miquel Sabaté Solà .</div>
<p style="color: grey;"><i>Updated April 21, 2014, 10:59 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kate
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This is another item I had on my To Do list regarding visual mode :) \
Currently Kate crashes in this example (command: "2lvjc"):
Hello
World
Note that the applied command will also make Kate crash for an empty document. \
Anyways, the problem here is that when the user selects a range of text in visual \
mode from up to down and it presses c, the cursor is placed in the last line. This is \
not what we want for the following reasons:
1. It's a bit unexpected. As an example, perform the "2lvjcX" sequence \
in this text:
Hello
World
Another
The end results is:
Held
AnXother
That is, the cursor has been placed in the word "Another", even if this \
word had nothing to do with the selection.
2. It's not only unexpected, it's wrong :) In my previous example, the cursor \
is placed in "Another". This is because "2lvj" selected the first \
two lines. However, when the user presses "c", the first two commands have \
to be joined, and, therefore, now in the second line we have another word. So, what \
I'm trying to say, the current behavior doesn't work when we hit a command \
that has to remove end of line characters.
As I said previously, all of these things happen when we select a range of text from \
up to down (the line where we started the selection is on top of the line where we \
ended the selection). However, this doesn't happen when we do from down to up. \
That's why in this patch I only focus on this case (m_commandRange.startLine < \
m_commandRange.endLine). </pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">All tests are passing. I've also added a couple of tests for \
this.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>part/vimode/katevinormalmode.cpp <span style="color: grey">(232b38d)</span></li>
<li>tests/vimode_test.cpp <span style="color: grey">(407641d)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/117672/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic