Bug 452853 - Make cursor insertion point a few pixels larger vertically
Summary: Make cursor insertion point a few pixels larger vertically
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Other
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-04-22 12:04 UTC by shenlebantongying
Modified: 2023-04-04 19:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A screenshot of this larger beam. (58.44 KB, image/png)
2022-04-22 12:04 UTC, shenlebantongying
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shenlebantongying 2022-04-22 12:04:22 UTC
Created attachment 148299 [details]
A screenshot of this larger beam.

In SublimeText4, there is a subtle but really really nice feature that improves cursor visibility greatly: 

The cursor beam is vertically a few pixels larger in normal fonts.

Sublime's homepage. There is no explicit mention of this detail, but you can notice the larger beam in their demos. Also, it is "free" to download and have a try.
https://www.sublimetext.com/

Extra screenshot:
https://moe.cat/web/@shenlebantongying/107410927271781828
Comment 1 Bug Janitor Service 2023-03-29 11:49:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/532
Comment 2 Christoph Cullmann 2023-03-29 19:42:06 UTC
Git commit 5934689df192aa681c6d7856bd6eaed9f22790a5 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 29/03/2023 at 18:10.
Pushed by cullmann into branch 'master'.

Draw caret ourselves

Drawing caret ourselves helps solve a few issues:

1. With custom line height, the caret is no longer smaller than line
2. Cursor direction depends on the block content, not keyboard layout
(bug 172630). Our own cursor will not draw the direction marker and
thus will avoid this issue
3. Make cursor insertion point a few pixels larger vertically (bug 452853).
You can just increase the line height and the caret will be bigger :)
Technically, this is not exactly what is requested, but it works. Making
Cursor visually larger than the line is _possible_ but it means that now
we need to _always_ dirty 3 lines for repaint: current line, line above,
line below which is a lot of uneeded work for such a small thing. So this
will do.

It is also more efficient than the Qt implementation as the work done in
here is a lot less.
Related: bug 172630

M  +24   -1    src/render/katerenderer.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/5934689df192aa681c6d7856bd6eaed9f22790a5
Comment 3 Waqar Ahmed 2023-04-04 19:33:55 UTC
Git commit 9a07647ee120da5b046cc71186590decebc8ded9 by Waqar Ahmed.
Committed on 04/04/2023 at 18:59.
Pushed by cullmann into branch 'kf5'.

Draw caret ourselves

Drawing caret ourselves helps solve a few issues:

1. With custom line height, the caret is no longer smaller than line
2. Cursor direction depends on the block content, not keyboard layout
(bug 172630). Our own cursor will not draw the direction marker and
thus will avoid this issue
3. Make cursor insertion point a few pixels larger vertically (bug 452853).
You can just increase the line height and the caret will be bigger :)
Technically, this is not exactly what is requested, but it works. Making
Cursor visually larger than the line is _possible_ but it means that now
we need to _always_ dirty 3 lines for repaint: current line, line above,
line below which is a lot of uneeded work for such a small thing. So this
will do.

It is also more efficient than the Qt implementation as the work done in
here is a lot less.
Related: bug 172630

M  +24   -1    src/render/katerenderer.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/9a07647ee120da5b046cc71186590decebc8ded9