Cudatext: Plugins which use ed.markers(), ed.attr() should use new API PROC_GET_UNIQUE_TAG

Created on 13 Jan 2021  ·  16Comments  ·  Source: Alexey-T/CudaText

Todo after release of 1.122.0

plugins

All 16 comments

Hilite_Occurrences have lines with attr, Could you show us an example in how will be the new piece of code?

image

MARKTAG is fixed const. with new API it will be not const. it will be from app_proc(PROC_GET_UNIQ_TAG).

Почему в заголовке написано ДОЛЖНЫ?
Старые плаги испортятся?
ФиФ3/ФиФ4 применяют марки.

Old plugins won't break. they should!! use new API.

Не понял. Переведите

"старые- не сломаются. просто лучше заюзать и новое АПИ".

So, @Alexey-T

In this case:

ed_self.attr(app.MARKERS_ADD_MANY, MARKTAG, xx, yy, nn,
             color_font=opt.COLOR_FONT_OTHER,
             color_bg=opt.COLOR_BG_OTHER,
             color_border=opt.COLOR_BRD_OTHER,
             border_left=opt.BRD_OTHER,
             border_right=opt.BRD_OTHER,
             border_up=opt.BRD_OTHER,
             border_down=opt.BRD_OTHER,
             )

Is the idea now to use something like?

ed_self.attr(app.MARKERS_ADD_MANY, app_proc(PROC_GET_UNIQ_TAG), xx, yy, nn,
             color_font=opt.COLOR_FONT_OTHER,
             color_bg=opt.COLOR_BG_OTHER,
             color_border=opt.COLOR_BRD_OTHER,
             border_left=opt.BRD_OTHER,
             border_right=opt.BRD_OTHER,
             border_up=opt.BRD_OTHER,
             border_down=opt.BRD_OTHER,
             )

nope, MARKTAG must be calculated only ONCE for runtime.

Using this way right?

# Variable with module level scope
MARKTAG = app_proc(PROC_GET_UNIQ_TAG)

# More code...

# More code...

# More code...
ed_self.attr(app.MARKERS_ADD_MANY, MARKTAG, xx, yy, nn,
             color_font=opt.COLOR_FONT_OTHER,
             color_bg=opt.COLOR_BG_OTHER,
             color_border=opt.COLOR_BRD_OTHER,
             border_left=opt.BRD_OTHER,
             border_right=opt.BRD_OTHER,
             border_up=opt.BRD_OTHER,
             border_down=opt.BRD_OTHER,
             )

yes, this way.

done.
some plugins were NOT fixed, they will break from this. (Hilite Occur, SpellCheck, ColoredText)

I will check now Hilite Occur and ColoredText, but I suppose following a previous above comment, this change in API will not break current functionality. Because the last change in props #3227 in this case, in effect the changes in the API were breaking the "painting" using the deprecated property.

HiliteOccur/ SpellChk-- Cud needs fixed marker tags to show it on micromap!
ColoreTxt-- plugin needs fixed tag to load it from file.

I am checking cuda_hilite_occurrences and I can see recent changes; will you continue with more? Is still pending to implement?:

Cud needs fixed marker tags to show it on micromap!

I changed

CSV_Helper
SyncEditing
Hilite_Variables
Colored_Indent

these don't need change

Hi_Occur
SpellChk
Color_Text
Differ (maybe it needs but author is busy)

Is still pending to implement?:

no, all is done.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jczanfona picture jczanfona  ·  5Comments

Alexey-T picture Alexey-T  ·  4Comments

junguler picture junguler  ·  5Comments

charliewales picture charliewales  ·  4Comments

Alexey-T picture Alexey-T  ·  3Comments