From kwrite-devel Wed Mar 05 19:09:38 2014 From: "Matthew Woehlke" Date: Wed, 05 Mar 2014 19:09:38 +0000 To: kwrite-devel Subject: Re: Review Request 115443: Added a "Relative line numbers" option. Message-Id: <20140305190938.30951.44714 () probe ! kde ! org> X-MARC-Message: https://marc.info/?l=kwrite-devel&m=139404659120539 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============3871780150001422012==" --===============3871780150001422012== Content-Type: multipart/alternative; boundary="===============3909735680409271630==" --===============3909735680409271630== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > On March 5, 2014, 12:10 p.m., Michal Humpula wrote: > > Love it. Just a few micro-issues. > > > > We don't have to stick with precise Vim functionality, so what are you saying about prefixing the numbers before current line with minus sign? Do you think it would make more sense? In vim case it would waste one terminal column, but in kate it's few pixels. > > > > Hate the checkbox, we realy need the ":set numbers" like functionality in kate. But for now it will have to do. > > > > Don't like another vi-mode specific switch in kateview. In long term I would like to cut out vi-mode specific code from the rest of the codebase as much as possible. But that's for KF5. So go ahead with this. Let's see what will happen in KF5 at the end. > > > > I agree that for non-vi-mode users this feature doesn't make much sense, so putting it to vi-mode only makes sense. > > > > Since everything I've described is optional, I'm giving the ship it. > > Miquel Sabaté Solà wrote: > I don't like the minus sign idea. My way of thinking is "2 lines above", not "-2 lines". I guess that I'm too used to how vim handles this :) And for mere aesthetics, I also prefer vim's way :P > > I agree with the rest of your comment. You could always use e.g. 2↑ 2↓ instead :-). We also are more able to assume a decent unicode font. - Matthew ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/115443/#review52103 ----------------------------------------------------------- On March 5, 2014, 1:50 p.m., Miquel Sabaté Solà wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/115443/ > ----------------------------------------------------------- > > (Updated March 5, 2014, 1:50 p.m.) > > > Review request for Kate. > > > Repository: kate > > > Description > ------- > > Ok, here it goes a "crazy" idea :) In vim there's the "relativenumber" option. In short, this means that in the left border we no longer have absolute line numbers but line numbers relative to the current cursor (see the "relative.png" attachment). This is useful since in vim all commands accept an optional number (that is relative to the current cursor). This feature is, of course, configurable and set to false by default. Moreover since this is a feature that, in my opinion, only makes sense in vim, I've added this option under the "Vi Input Mode" tab in the configuration (see the "relative1.png" attachment). > > This is cool and everything, but it's not fully working yet :( We don't want to be updating the left border all the time (otherwise the CPU usage goes kind of crazy, 20% more or less with KWrite). I'm only updating the left border when the user moves up or down. However, in some situations the line numbering does not update. An example of this is opening a large file, going in the middle of the file and then starting to move up and down. For some reason in this situation the left border is not updated. Since I'm kind of new to the KateView code, I'd like to hear suggestions and tips so we can fix this issue :P > > Thanks for your time :) ! > > > Diffs > ----- > > part/dialogs/katedialogs.cpp 4de0628 > part/dialogs/viinputmodeconfigwidget.ui 29a5257 > part/utils/kateconfig.h d5f085b > part/utils/kateconfig.cpp 20c4494 > part/view/kateview.h fc15b94 > part/view/kateview.cpp f5c8d6f > part/view/kateviewhelpers.h 7f76ed3 > part/view/kateviewhelpers.cpp 80eebb67 > part/view/kateviewinternal.h 5d7c2f4 > part/view/kateviewinternal.cpp 505cb93 > > Diff: https://git.reviewboard.kde.org/r/115443/diff/ > > > Testing > ------- > > Manual testing. It's not working properly yet, take a look at the "Description" section above. > > > File Attachments > ---------------- > > A snapshot > https://git.reviewboard.kde.org/media/uploaded/files/2014/02/03/09554ab4-fc68-4044-8629-3aa6c65e0f10__relative.png > Option > https://git.reviewboard.kde.org/media/uploaded/files/2014/02/03/88e089f9-a3ab-4622-b9a0-d017ab57b349__relative1.png > > > Thanks, > > Miquel Sabaté Solà > > --===============3909735680409271630== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit
This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/115443/

On March 5th, 2014, 12:10 p.m. EST, Michal Humpula wrote:

Love it. Just a few micro-issues.

We don't have to stick with precise Vim functionality, so what are you saying about prefixing the numbers before current line with minus sign? Do you think it would make more sense? In vim case it would waste one terminal column, but in kate it's few pixels.

Hate the checkbox, we realy need the ":set numbers" like functionality in kate. But for now it will have to do.

Don't like another vi-mode specific switch in kateview. In long term I would like to cut out vi-mode specific code from the rest of the codebase as much as possible. But that's for KF5. So go ahead with this. Let's see what will happen in KF5 at the end.

I agree that for non-vi-mode users this feature doesn't make much sense, so putting it to vi-mode only makes sense.

Since everything I've described is optional, I'm giving the ship it.

On March 5th, 2014, 1:37 p.m. EST, Miquel Sabaté Solà wrote:

I don't like the minus sign idea. My way of thinking is "2 lines above", not "-2 lines". I guess that I'm too used to how vim handles this :) And for mere aesthetics, I also prefer vim's way :P

I agree with the rest of your comment.
You could always use e.g. 2↑ 2↓ instead :-). We also are more able to assume a decent unicode font.

- Matthew


On March 5th, 2014, 1:50 p.m. EST, Miquel Sabaté Solà wrote:

Review request for Kate.
By Miquel Sabaté Solà.

Updated March 5, 2014, 1:50 p.m.

Repository: kate

Description

Ok, here it goes a "crazy" idea :) In vim there's the "relativenumber" option. In short, this means that in the left border we no longer have absolute line numbers but line numbers relative to the current cursor (see the "relative.png" attachment). This is useful since in vim all commands accept an optional number (that is relative to the current cursor). This feature is, of course, configurable and set to false by default. Moreover since this is a feature that, in my opinion, only makes sense in vim, I've added this option under the "Vi Input Mode" tab in the configuration (see the "relative1.png" attachment).

This is cool and everything, but it's not fully working yet :( We don't want to be updating the left border all the time (otherwise the CPU usage goes kind of crazy, 20% more or less with KWrite). I'm only updating the left border when the user moves up or down. However, in some situations the line numbering does not update. An example of this is opening a large file, going in the middle of the file and then starting to move up and down. For some reason in this situation the left border is not updated. Since I'm kind of new to the KateView code, I'd like to hear suggestions and tips so we can fix this issue :P

Thanks for your time :) !

Testing

Manual testing. It's not working properly yet, take a look at the "Description" section above.

Diffs

  • part/dialogs/katedialogs.cpp (4de0628)
  • part/dialogs/viinputmodeconfigwidget.ui (29a5257)
  • part/utils/kateconfig.h (d5f085b)
  • part/utils/kateconfig.cpp (20c4494)
  • part/view/kateview.h (fc15b94)
  • part/view/kateview.cpp (f5c8d6f)
  • part/view/kateviewhelpers.h (7f76ed3)
  • part/view/kateviewhelpers.cpp (80eebb67)
  • part/view/kateviewinternal.h (5d7c2f4)
  • part/view/kateviewinternal.cpp (505cb93)

View Diff

File Attachments

--===============3909735680409271630==-- --===============3871780150001422012== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KWrite-Devel mailing list KWrite-Devel@kde.org https://mail.kde.org/mailman/listinfo/kwrite-devel --===============3871780150001422012==--