geany / geany-plugins

The combined Geany Plugins collection
http://plugins.geany.org/
594 stars 266 forks source link

[request] Show current character Unicode code point #1005

Open jesus2099 opened 4 years ago

jesus2099 commented 4 years ago

It would be very useful to either display current character code in status bar – à la BabelPad – or provide a shortcut key to open a popup with full character information, like full Unicode code and name – à la EmEditor.

Examples:

eht16 commented 4 years ago

Sounds quite useful. But I moved to issue to the https://github.com/geany/geany-plugins/ as it should be implemented as a plugin, ideally.

Any volunteers are welcome!

jesus2099 commented 3 years ago

It would be nice that the statusbar template could get new placeholders for character position (see https://github.com/geany/geany/issues/2733) and character code and/or name:

BabelPad

Above text line « // ö » consists of 6 characters (the 6th one having the caret cursor):

  1. U+0009 : CHARACTER TABULATION, HORIZONTAL TABULATION [HT, TAB] : horizontal tabulation (HT), tab
  2. U+002F SOLIDUS : slash
  3. U+002F SOLIDUS : slash
  4. U+0020 SPACE [SP]
  5. U+006F LATIN SMALL LETTER O
  6. U+0308 COMBINING DIAERESIS : double dot above, umlaut, Greek dialytika, double derivative

Note: I use Geany on Linux, but EmEditor and BabelPad are Windows only softwares.

elextr commented 3 years ago

I assume that by your loose use of "character" you actually mean Unicode code point. When we are talking about these things its important to be precise, as was pointed out on #2733.

A well written pull request that added say %u to the status bar template values to show the code point in the line would probably be accepted, just needs care to minimise the cost as it would have to be counted each update, and some people insist on editing minimised HTML/JS that is all one line. [Edit: note this isn't currently possible in a plugin AFAIK]

Adding the character names requires the unicode data files (AFAICT its not available from any of the libraries Geany currently uses or something like ICU) and could be fairly big. Thats the sort of thing that should be put in a plugin so the cost isn't incurred by those not needing it.

jesus2099 commented 3 years ago

Thanks for the correct Unicode code point. :) It's all English and I don't master it.

I would likely convert this ticket to Unicode code point only, back to geany/geany instead of geany/geany-plugins.

elextr commented 3 years ago

Unicode code point sounds like a genuine feature of Geany, more than a plugin

Correct as the edit above said and on geany/geany#2733

jesus2099 commented 3 years ago

A well written pull request that added say %u to the status bar template values to show the code point in the line would probably be accepted,

Unfortunately, I only know little bit of JavaScript. :-/

just needs care to minimise the cost as it would have to be counted each update, and some people insist on editing minimised HTML/JS that is all one line.

@elextr Do you know if it would be always computed or only when the user includes %u in their statusbar template?

elextr commented 3 years ago

Do you know if it would be always computed or only when the user includes %u in their statusbar template.

This is a question for the new issue you were asked to create on the Geany repo for that.

Keep this issue for the plugin for character names, and that issue on Geany itself for the statusbar addition.