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

List:       kwrite-devel
Subject:    Re: Review Request 119359: vimode: cleaning up the KateViRange class.
From:       Miquel_Sabaté_Solà <mikisabate () gmail ! com>
Date:       2014-07-19 10:48:30
Message-ID: 20140719104830.21437.81771 () probe ! kde ! org
[Download RAW message or body]

--===============2787254759446883062==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119359/
-----------------------------------------------------------

(Updated July 19, 2014, 10:48 a.m.)


Status
------

This change has been marked as submitted.


Review request for Kate and Michal Humpula.


Repository: ktexteditor


Description
-------

The KateViRange class is used quite extensively across the vimode code, so I decided \
to take a closer look at it. For this, I've done the following changes:

* I've cleaned up a bit the style (+ things like explicit).
* I've added two constructors. These constructors use KTextEditor::Cursor, and they \
are equivalent to the other two constructors that take arguments. At first I wanted \
to replace these constructors with these new ones, but then I realized they sort of \
complement each other: sometimes it's easier to just use the plain old ones, and \
                sometimes it's more comfortable to use cursors.
* Finally I've adapted the code to these new changes. You'll see a lot of places \
where I've replaced the old constructors with the new ones since they fit better \
there.

That's cool, but there's one more thing for debate: the KateVi namespace. There's a \
couple of conflicts here:

* If we apply the logic that we've followed so far when porting things to the KateVi \
namespace, we see that KateViRange -> KateVi::Range. This, of course, causes *lots* \
of conflicts with KTextEditor::Range. I tried to fix these conflicts, but it was \
                burning hell :D
* But even if we successfully port it to KateVi::Range, I think that as a developer \
it would be quite easy to mix up KateVi::Range and KTE::Range in the code, so it \
would be very confusing. Therefore, I don't think that renaming it to KateVi::Range \
is such a good idea.

Anyways, I still want the KateViRange class to be in the KateVi namespace. I've \
thought to rename it KateVi::ViRange or something like that (KateVi::KateViRange \
would be cumbersome :P). Any thoughts ?


Diffs
-----

  src/vimode/katevivisualmode.h 185f278 
  src/vimode/katevivisualmode.cpp 1c7c579 
  src/vimode/range.h PRE-CREATION 
  src/vimode/range.cpp PRE-CREATION 
  src/vimode/searcher.h 8849e02 
  src/vimode/searcher.cpp 635f232 
  src/vimode/katevirange.h e97e983 
  src/vimode/katevirange.cpp 55d7e8a 
  src/vimode/katevinormalmode.h 8f144cb 
  src/vimode/katevinormalmode.cpp 6375097 
  src/CMakeLists.txt b3a6359 
  src/vimode/kateviinsertmode.h 19f0d2c 
  src/vimode/kateviinsertmode.cpp b2c8de8 
  src/vimode/katevimodebase.h bbd1eab 
  src/vimode/katevimodebase.cpp 35e99b3 
  src/vimode/katevimotion.h 605be1d 
  src/vimode/katevimotion.cpp 2b5b937 

Diff: https://git.reviewboard.kde.org/r/119359/diff/


Testing
-------

make test


Thanks,

Miquel Sabaté Solà 


--===============2787254759446883062==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/119359/">https://git.reviewboard.kde.org/r/119359/</a>
  </td>
    </tr>
   </table>
   <br />




<table bgcolor="#e0e0e0" width="100%" cellpadding="12" style="border: 1px gray solid; \
border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  <tr>
  <td>
   <h1 style="margin: 0; padding: 0; font-size: 10pt;">This change has been marked as \
submitted.</h1>  </td>
 </tr>
</table>
<br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for Kate and Michal Humpula.</div>
<div>By Miquel Sabaté Solà .</div>


<p style="color: grey;"><i>Updated July 19, 2014, 10:48 a.m.</i></p>









<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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">The KateViRange class is used quite extensively across \
the vimode code, so I decided to take a closer look at it. For this, I've done the \
following changes:</p> <ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 \
1em;line-height: inherit;white-space: normal;"> <li style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: normal;">I've cleaned up a bit \
the style (+ things like explicit).</li> <li style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: normal;">I've added two \
constructors. These constructors use KTextEditor::Cursor, and they are equivalent to \
the other two constructors that take arguments. At first I wanted to replace these \
constructors with these new ones, but then I realized they sort of complement each \
other: sometimes it's easier to just use the plain old ones, and sometimes it's more \
comfortable to use cursors.</li> <li style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: normal;">Finally I've adapted the \
code to these new changes. You'll see a lot of places where I've replaced the old \
constructors with the new ones since they fit better there.</li> </ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">That's cool, but there's one more thing for debate: \
the KateVi namespace. There's a couple of conflicts here:</p> <ul style="padding: \
0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: \
normal;"> <li style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;">If we apply the logic that we've followed so far when \
porting things to the KateVi namespace, we see that KateViRange -&gt; KateVi::Range. \
This, of course, causes <em style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: normal;">lots</em> of conflicts with \
KTextEditor::Range. I tried to fix these conflicts, but it was burning hell :D</li> \
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: normal;">But even if we successfully port it to KateVi::Range, I \
think that as a developer it would be quite easy to mix up KateVi::Range and \
KTE::Range in the code, so it would be very confusing. Therefore, I don't think that \
renaming it to KateVi::Range is such a good idea.</li> </ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Anyways, I still want the KateViRange class to be in \
the KateVi namespace. I've thought to rename it KateVi::ViRange or something like \
that (KateVi::KateViRange would be cumbersome :P). Any thoughts ?</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">make test</p></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>src/vimode/katevivisualmode.h <span style="color: grey">(185f278)</span></li>

 <li>src/vimode/katevivisualmode.cpp <span style="color: grey">(1c7c579)</span></li>

 <li>src/vimode/range.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/vimode/range.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/vimode/searcher.h <span style="color: grey">(8849e02)</span></li>

 <li>src/vimode/searcher.cpp <span style="color: grey">(635f232)</span></li>

 <li>src/vimode/katevirange.h <span style="color: grey">(e97e983)</span></li>

 <li>src/vimode/katevirange.cpp <span style="color: grey">(55d7e8a)</span></li>

 <li>src/vimode/katevinormalmode.h <span style="color: grey">(8f144cb)</span></li>

 <li>src/vimode/katevinormalmode.cpp <span style="color: grey">(6375097)</span></li>

 <li>src/CMakeLists.txt <span style="color: grey">(b3a6359)</span></li>

 <li>src/vimode/kateviinsertmode.h <span style="color: grey">(19f0d2c)</span></li>

 <li>src/vimode/kateviinsertmode.cpp <span style="color: grey">(b2c8de8)</span></li>

 <li>src/vimode/katevimodebase.h <span style="color: grey">(bbd1eab)</span></li>

 <li>src/vimode/katevimodebase.cpp <span style="color: grey">(35e99b3)</span></li>

 <li>src/vimode/katevimotion.h <span style="color: grey">(605be1d)</span></li>

 <li>src/vimode/katevimotion.cpp <span style="color: grey">(2b5b937)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/119359/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>




  </div>
 </body>
</html>


--===============2787254759446883062==--



_______________________________________________
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