[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: Re: Review Request 119012: vi-mode: refactor vimarks
From: Miquel_Sabaté_Solà <mikisabate () gmail ! com>
Date: 2014-06-29 12:34:28
Message-ID: 20140629123428.7884.33974 () 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/119012/#review61170
-----------------------------------------------------------
src/vimode/marks.h
<https://git.reviewboard.kde.org/r/119012/#comment42599>
I'm all in favor of using C++ namespaces. However, I think that we don't use \
namespaces anywhere else in the vi-mode code. So, we have two options here:
1. We "standardize" a namespace for the vi-mode code (e.g. "KateVi" or simply \
"Vi"). 2. Rename this class to KateViMarks
src/vimode/marks.h
<https://git.reviewboard.kde.org/r/119012/#comment42600>
Since it's a Cursor and for cursors it's "start" instead of "begin" (e.g. \
startLine), I say we call this "getStartEditYanked".
src/vimode/marks.h
<https://git.reviewboard.kde.org/r/119012/#comment42601>
Same here: "getSelectionStart"
src/vimode/marks.cpp
<https://git.reviewboard.kde.org/r/119012/#comment42602>
The "else" is not really needed here ;)
src/vimode/marks.cpp
<https://git.reviewboard.kde.org/r/119012/#comment42603>
Maybe we can use C++11's new "foreach" syntax ?
src/vimode/marks.cpp
<https://git.reviewboard.kde.org/r/119012/#comment42604>
Same as above, can't we use C++11's "foreach" syntax?
- Miquel Sabaté SolÃ
On June 29, 2014, 11:12 a.m., Michal Humpula wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119012/
> -----------------------------------------------------------
>
> (Updated June 29, 2014, 11:12 a.m.)
>
>
> Review request for Kate and Miquel Sabaté Solà .
>
>
> Repository: ktexteditor
>
>
> Description
> -------
>
> Larger refactor with the included fix for restoring only the user marks visibility.
>
> The names are probably not ideal, suggestions welcomed. The \
> KateViInputModeManager::error and KateViInputModeManager::message would probably \
> need more attention too.
>
> Diffs
> -----
>
> src/CMakeLists.txt 71f5ec5
> src/inputmode/kateviinputmode.cpp 3059a62
> src/vimode/katevicmds.cpp eeb37d7
> src/vimode/katevicommandrangeexpressionparser.cpp 79620d4
> src/vimode/kateviinputmodemanager.h 0d08d2d
> src/vimode/kateviinputmodemanager.cpp a44b8a4
> src/vimode/kateviinsertmode.cpp 8b8f96e
> src/vimode/katevinormalmode.cpp 9643d60
> src/vimode/katevivisualmode.cpp 25d4bd9
> src/vimode/marks.h PRE-CREATION
> src/vimode/marks.cpp PRE-CREATION
>
> Diff: https://git.reviewboard.kde.org/r/119012/diff/
>
>
> Testing
> -------
>
> make test + manual testing
>
>
> Thanks,
>
> Michal Humpula
>
>
[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/119012/">https://git.reviewboard.kde.org/r/119012/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/119012/diff/1/?file=285245#file285245line36" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/vimode/marks.h</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">36</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="n">namespace</span> <span class="n">KateVi</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'm all \
in favor of using C++ namespaces. However, I think that we don't use namespaces \
anywhere else in the vi-mode code. So, we have two options here:
1. We "standardize" a namespace for the vi-mode code (e.g. \
"KateVi" or simply "Vi"). 2. Rename this class to \
KateViMarks</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/119012/diff/1/?file=285245#file285245line56" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/vimode/marks.h</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">56</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KTextEditor</span><span class="o">::</span><span class="n">Cursor</span> \
<span class="n">getBeginEditYanked</span><span class="p">()</span> <span \
class="k">const</span><span class="p">;</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Since \
it's a Cursor and for cursors it's "start" instead of \
"begin" (e.g. startLine), I say we call this \
"getStartEditYanked".</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/119012/diff/1/?file=285245#file285245line60" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/vimode/marks.h</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">60</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">KTextEditor</span><span class="o">::</span><span class="n">Cursor</span> \
<span class="n">getSelectionBegin</span><span class="p">()</span> <span \
class="k">const</span><span class="p">;</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Same here: \
"getSelectionStart"</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/119012/diff/1/?file=285246#file285246line120" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/vimode/marks.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">120</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="p">}</span> <span class="k">else</span> <span class="p">{</span></pre></td> \
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The \
"else" is not really needed here ;)</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/119012/diff/1/?file=285246#file285246line164" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/vimode/marks.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">164</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">for</span> <span class="p">(</span><span class="n">QHash</span><span \
class="o"><</span><span class="kt">int</span><span class="p">,</span> <span \
class="n">KTextEditor</span><span class="o">::</span><span class="n">Mark</span> \
<span class="o">*>::</span><span class="n">const_iterator</span> <span \
class="n">it</span> <span class="o">=</span> <span class="n">m</span><span \
class="p">.</span><span class="n">constBegin</span><span class="p">();</span> <span \
class="n">it</span> <span class="o">!=</span> <span class="n">m</span><span \
class="p">.</span><span class="n">constEnd</span><span class="p">();</span> <span \
class="o">++</span><span class="n">it</span><span class="p">)</span> <span \
class="p">{</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Maybe we \
can use C++11's new "foreach" syntax ?</pre> </div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="https://git.reviewboard.kde.org/r/119012/diff/1/?file=285246#file285246line191" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/vimode/marks.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">191</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">for</span> <span class="p">(</span><span class="n">QHash</span><span \
class="o"><</span><span class="kt">int</span><span class="p">,</span> <span \
class="n">KTextEditor</span><span class="o">::</span><span class="n">Mark</span> \
<span class="o">*>::</span><span class="n">const_iterator</span> <span \
class="n">it</span> <span class="o">=</span> <span class="n">m</span><span \
class="p">.</span><span class="n">constBegin</span><span class="p">();</span> <span \
class="n">it</span> <span class="o">!=</span> <span class="n">m</span><span \
class="p">.</span><span class="n">constEnd</span><span class="p">();</span> <span \
class="o">++</span><span class="n">it</span><span class="p">)</span> <span \
class="p">{</span></pre></td> </tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Same as \
above, can't we use C++11's "foreach" syntax?</pre> </div>
<br />
<p>- Miquel Sabaté Solà </p>
<br />
<p>On June 29th, 2014, 11:12 a.m. UTC, Michal Humpula 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 Miquel Sabaté Solà .</div>
<div>By Michal Humpula.</div>
<p style="color: grey;"><i>Updated June 29, 2014, 11:12 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;">Larger refactor with the included fix for restoring only the user marks \
visibility.
The names are probably not ideal, suggestions welcomed. The \
KateViInputModeManager::error and KateViInputModeManager::message would probably need \
more attention too.</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;">make test + manual testing</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/CMakeLists.txt <span style="color: grey">(71f5ec5)</span></li>
<li>src/inputmode/kateviinputmode.cpp <span style="color: \
grey">(3059a62)</span></li>
<li>src/vimode/katevicmds.cpp <span style="color: grey">(eeb37d7)</span></li>
<li>src/vimode/katevicommandrangeexpressionparser.cpp <span style="color: \
grey">(79620d4)</span></li>
<li>src/vimode/kateviinputmodemanager.h <span style="color: \
grey">(0d08d2d)</span></li>
<li>src/vimode/kateviinputmodemanager.cpp <span style="color: \
grey">(a44b8a4)</span></li>
<li>src/vimode/kateviinsertmode.cpp <span style="color: grey">(8b8f96e)</span></li>
<li>src/vimode/katevinormalmode.cpp <span style="color: grey">(9643d60)</span></li>
<li>src/vimode/katevivisualmode.cpp <span style="color: grey">(25d4bd9)</span></li>
<li>src/vimode/marks.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/vimode/marks.cpp <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/119012/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