Notepads: [Feature Request]: Add option to enable line numbers on the left margin

Created on 4 Jul 2019  路  10Comments  路  Source: JasonStein/Notepads

enhancement

Most helpful comment

WIP:
ezgif com-video-to-gif-2

All 10 comments

I do agree that this feature is useful even for plain text editor. However, it is not easy to do with my current approach (implementation related). I will revisit this later. What I can do next is to provide "Go to line" feature, but not line number in the near future.

Adding line number to the RichEditBox is a problem, it seems can not set a fixed line height, but you can use TextRange.GetPoint() to get the position of a line.

This is my old editor, and it also uses RichEditBox,
it supports line number && code highlight
https://github.com/Duronsoft/Just_Editor_UWP_Old
You can also check this new one, it uses my custom input controls
https://github.com/Duronsoft/Just_Editor_UWP

@Duronsoft thx for the tip, I was trying the similar way but ends up with misaligned line number and line content. It starts to getting off a little bit after few thousand lines so I completely gave up.

@JasonStein

Annotation 2019-12-30 190839
I found a new solution to get line height, it needs Direct2D API, I guess win2d also provides something similar, maybe you could try that.

Any news? line numbers would be awesome

@beerisgood I guess the best solution is to create a custom control, it means a lot of changes to this app, but it could get better performance.

鍚屽織锛屾湁鍏充簬琛屽彿鏄剧ず鐨勮繘灞曞浣曪紵

鍚屽織锛屾湁鍏充簬琛屽彿鏄剧ず鐨勮繘灞曞浣曪紵

ezgif com-video-to-gif (4)

WIP:
ezgif com-video-to-gif-2

This feature has been implemented in Notepads v1.3.0.0.
Closing this thread for now.

Was this page helpful?
0 / 5 - 0 ratings