[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Review Request 117774: vimode: fixed crash when mapping the u and the U commands.
From:       "Commit Hook" <null () kde ! org>
Date:       2014-04-25 21:36:19
Message-ID: 20140425213619.18037.60291 () 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/117774/#review56574
-----------------------------------------------------------


This review has been submitted with commit a2eee0f17e3587a8eefcdb99a333773669324744 \
by Miquel Sabaté to branch master.

- Commit Hook


On April 25, 2014, 8:57 p.m., Miquel Sabaté Solà wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117774/
> -----------------------------------------------------------
> 
> (Updated April 25, 2014, 8:57 p.m.)
> 
> 
> Review request for Kate, Michal Humpula and Simon St James.
> 
> 
> Bugs: 333784
> http://bugs.kde.org/show_bug.cgi?id=333784
> 
> 
> Repository: kate
> 
> 
> Description
> -------
> 
> Right now if you map any key to u or U (or <c-r>) and then you execute it, it will \
> crash. I realized about this crash because of the bug report #333784. In this bug \
> report it's said that it behaves incorrectly. However, in master this same case \
> just crashes. I'm not quite sure about this fix, since I don't know much about the \
> undo action in Kate. My reasoning is that when we execute a mapping, we do that by \
> calling editBegin() previously. After the mapping has been executed, we call \
> editEnd(). This is ok except by commands that have to deal with undo/redo actions. \
> So, what I do in this patch is to call editEnd before executing the undo/redo \
> operation so we avoid problems with the previous editBegin(), and we restore to the \
> previous state after executing the undo/redo command by calling editBegin() again. \
> It's a bit hackish, but I think is the best solution here. Note also that this \
> cannot be done in the KateViKeyMapper::executeMapping function since the mapping \
> may contain 
 many other commands that might need the be merged into a single undo-able edit as \
always.
> 
> 
> Diffs
> -----
> 
> part/vimode/katevinormalmode.cpp 0be6dda 
> tests/vimode_test.cpp 171088d 
> 
> Diff: https://git.reviewboard.kde.org/r/117774/diff/
> 
> 
> Testing
> -------
> 
> All tests are passing. I've also 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/117774/">https://git.reviewboard.kde.org/r/117774/</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 a2eee0f17e3587a8eefcdb99a333773669324744 by Miquel Sabaté to \
branch master.</pre>  <br />









<p>- Commit Hook</p>


<br />
<p>On April 25th, 2014, 8:57 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, Michal Humpula and Simon St James.</div>
<div>By Miquel Sabaté Solà .</div>


<p style="color: grey;"><i>Updated April 25, 2014, 8:57 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="http://bugs.kde.org/show_bug.cgi?id=333784">333784</a>


</div>



<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;">Right now if you map any key to u or U (or &lt;c-r&gt;) and then you \
execute it, it will crash. I realized about this crash because of the bug report \
#333784. In this bug report it&#39;s said that it behaves incorrectly. However, in \
master this same case just crashes. I&#39;m not quite sure about this fix, since I \
don&#39;t know much about the undo action in Kate. My reasoning is that when we \
execute a mapping, we do that by calling editBegin() previously. After the mapping \
has been executed, we call editEnd(). This is ok except by commands that have to deal \
with undo/redo actions. So, what I do in this patch is to call editEnd before \
executing the undo/redo operation so we avoid problems with the previous editBegin(), \
and we restore to the previous state after executing the undo/redo command by calling \
editBegin()   again. It&#39;s a bit hackish, but I think is the best solution here. \
Note also that this cannot be done in the KateViKeyMapper::executeMapping function \
since the mapping may contain many other commands that might need the be merged into \
a single undo-able edit as always.</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&#39;ve also 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>part/vimode/katevinormalmode.cpp <span style="color: grey">(0be6dda)</span></li>

 <li>tests/vimode_test.cpp <span style="color: grey">(171088d)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/117774/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