[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: Re: Review Request 118955: vimode: don't insert garbage characters when pressing r<backspace>
From: Miquel_Sabaté_Solà <mikisabate () gmail ! com>
Date: 2014-06-28 15:21:29
Message-ID: 20140628152129.18724.15323 () probe ! kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On June 28, 2014, 1:26 p.m., Michal Humpula wrote:
> > As for the kate master, it's probably ok. As for the ktexteditor, the only thing \
> > I personaly value are those tests. If the same problem is in the ktexteditor and \
> > the patch is easily ported, then it's ok. But I would like rework the whole \
> > parsing thing to something like statemachine, so it's easy to understand exact \
> > state of the whole editor.
>
> Miquel Sabaté Solà wrote:
> By parsing as a statemachine do you mean parsing commands in general or just for \
> normal mode? For this I tried to kind of merge the Replace mode with the replace \
> character, but it proved to be cumbersome, to say the least. So yes, we need some \
> cleanup about this.
> And yes, this bug also happens in ktexteditor (that's why this patch targets \
> ktexteditor ;) ). Therefore, I'm going to push this change and finally backport it \
> to kate master.
> Michal Humpula wrote:
> As for the statemachine, I mean for the whole key parsing/input. There is roughly \
> 10-20 places, where some relevant state is kept, which depends on the current input \
> key history and some keys go trought several loops in code before ending somewhere.
Ok, I see. Anyways, this kind of changes are *super* tricky. So it would be better to \
do this later on imho :)
- Miquel
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118955/#review61128
-----------------------------------------------------------
On June 26, 2014, 12:16 p.m., Miquel Sabaté Solà wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118955/
> -----------------------------------------------------------
>
> (Updated June 26, 2014, 12:16 p.m.)
>
>
> Review request for Kate and Michal Humpula.
>
>
> Bugs: 336357
> https://bugs.kde.org/show_bug.cgi?id=336357
>
>
> Repository: ktexteditor
>
>
> Description
> -------
>
> Right now the way we replace characters with the "r" command is too naive. If we \
> press keys like backspace, capslock, left, etc. after pressing "r", the replace \
> should be canceled. Moreover, if we press the enter key after pressing "r", then a \
> newline should be the character being added. All of these things are now possible \
> with this patch.
> This is not the cleanest patch ever (adding the encoded2qt function is a bit too \
> hack-ish), but I've tried fixing this in other ways and all of them failed \
> miserably :)
>
> Diffs
> -----
>
> autotests/src/vimode/modes.h 019097d
> autotests/src/vimode/modes.cpp 8519511
> src/vimode/katevikeyparser.h abfc3af
> src/vimode/katevikeyparser.cpp d97481c
> src/vimode/katevinormalmode.cpp 9643d60
>
> Diff: https://git.reviewboard.kde.org/r/118955/diff/
>
>
> Testing
> -------
>
> I've added a couple of tests.
>
>
> 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/118955/">https://git.reviewboard.kde.org/r/118955/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On June 28th, 2014, 1:26 p.m. UTC, <b>Michal \
Humpula</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;"> <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">As for the kate master, it's probably ok. As for the ktexteditor, \
the only thing I personaly value are those tests. If the same problem is in the \
ktexteditor and the patch is easily ported, then it's ok. But I would like rework \
the whole parsing thing to something like statemachine, so it's easy to \
understand exact state of the whole editor.</pre> </blockquote>
<p>On June 28th, 2014, 2:58 p.m. UTC, <b>Miquel Sabaté Solà </b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">By parsing as a \
statemachine do you mean parsing commands in general or just for normal mode? For \
this I tried to kind of merge the Replace mode with the replace character, but it \
proved to be cumbersome, to say the least. So yes, we need some cleanup about this.
And yes, this bug also happens in ktexteditor (that's why this patch targets \
ktexteditor ;) ). Therefore, I'm going to push this change and finally backport \
it to kate master.</pre> </blockquote>
<p>On June 28th, 2014, 3:13 p.m. UTC, <b>Michal Humpula</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">As for the statemachine, \
I mean for the whole key parsing/input. There is roughly 10-20 places, where some \
relevant state is kept, which depends on the current input key history and some keys \
go trought several loops in code before ending somewhere.</pre> </blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ok, I see. Anyways, this \
kind of changes are *super* tricky. So it would be better to do this later on imho \
:)</pre> <br />
<p>- Miquel</p>
<br />
<p>On June 26th, 2014, 12:16 p.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 and Michal Humpula.</div>
<div>By Miquel Sabaté Solà .</div>
<p style="color: grey;"><i>Updated June 26, 2014, 12:16 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://bugs.kde.org/show_bug.cgi?id=336357">336357</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
ktexteditor
</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;">Right now the way we replace characters with the "r" command \
is too naive. If we press keys like backspace, capslock, left, etc. after pressing \
"r", the replace should be canceled. Moreover, if we press the enter key \
after pressing "r", then a newline should be the character being added. All \
of these things are now possible with this patch.
This is not the cleanest patch ever (adding the encoded2qt function is a bit too \
hack-ish), but I've tried fixing this in other ways and all of them failed \
miserably :)</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;">I've added a couple of tests.</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>autotests/src/vimode/modes.h <span style="color: grey">(019097d)</span></li>
<li>autotests/src/vimode/modes.cpp <span style="color: grey">(8519511)</span></li>
<li>src/vimode/katevikeyparser.h <span style="color: grey">(abfc3af)</span></li>
<li>src/vimode/katevikeyparser.cpp <span style="color: grey">(d97481c)</span></li>
<li>src/vimode/katevinormalmode.cpp <span style="color: grey">(9643d60)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/118955/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