Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserve resource ID for schemes #182

Closed
zufuliu opened this issue Apr 23, 2020 · 7 comments
Closed

Reserve resource ID for schemes #182

zufuliu opened this issue Apr 23, 2020 · 7 comments

Comments

@zufuliu
Copy link
Owner

zufuliu commented Apr 23, 2020

Since v4.20.04, resource ids for lexers/schemes are saved in default scheme and favorite schemes preferences to replaced the unstable lexer index. for compatibility reason, it's better to reserved these ids already used by existing forks/modifications.

Scheme Source ID
AviSynth Script Korean version[1], issue #18 --
AutoHotkey Script Korean version[1], issue #17 --
Markdown Korean version[1], issue #157 --
CoffeeScript Korean version[1], issue #19 --
Intel Hex Korean version --

@bluenlive do you have other schemes? it's even better if you already have these ids (in [63000, 63100], but not used in EditLexer.h).

@zufuliu zufuliu changed the title Reserve resource id for lexers/schemes Reserve resource ids for lexers/schemes Apr 23, 2020
@bluenlive
Copy link

Oh, thank you.
I'm using following schemes.

Would it be better to use IDs higher than 63100?
SCLEX_AVS --> 63101
SCLEX_AHK --> 63102... and so on?

#define NP2LEX_AHK			63095	// SCLEX_AHK		AutoHotkey Script
#define NP2LEX_COFFEESCRIPT	63094	// SCLEX_COFFEESCRIPT	Coffeescript
#define NP2LEX_REGISTRY		63093	// SCLEX_REGISTRY	Windows Registry Files
#define NP2LEX_MARKDOWN		63092	// SCLEX_MARKDOWN	Markdown
#define NP2LEX_SRT			63091	// SCLEX_SRT		Srt Subtitle
#define NP2LEX_SREC			63090	// SCLEX_SREC		Motorola S-Record
#define NP2LEX_IHEX			63089	// SCLEX_IHEX		Intel HEX
#define NP2LEX_TEHEX		63088	// SCLEX_TEHEX		Tektronix extended HEX```

@zufuliu
Copy link
Owner Author

zufuliu commented Apr 24, 2020

values larger than 63100 already used by styles (in EditLexers\EditStyle.h).
see https://github.com/zufuliu/notepad2/blob/master/src/EditLexers/EditStyle.h
and https://github.com/XhmikosR/notepad2-mod/blob/master/src/Styles.c#L50

Change resource ids for styles is easy, it will not breaking end users. When we are going to support 100 schemes, resource ids for styles can be increased by 100 with a simple regex replace in EditStyle.h; at that time MAX_FAVORITE_SCHEMES_CONFIG_SIZE will need be increased to 1 + MAX_FAVORITE_SCHEMES_COUNT*4 too.

@zufuliu zufuliu changed the title Reserve resource ids for lexers/schemes Reserve resource ID for schemes Apr 24, 2020
zufuliu added a commit that referenced this issue Apr 24, 2020
@zufuliu
Copy link
Owner Author

zufuliu commented Apr 24, 2020

Added these IDs in 61a4158, only 22 unused now, though I think it still need several years to use all of them.

@bluenlive
Copy link

Thank you so much. 👍

zufuliu added a commit that referenced this issue May 7, 2020
@zufuliu
Copy link
Owner Author

zufuliu commented May 7, 2020

Resource id for styles are increased by 100 in 20e94a3, values in [63000, 63200] can be used as resource id for schemes.

RaiKoHoff pushed a commit to RaiKoHoff/notepad2 that referenced this issue Jul 19, 2021
RaiKoHoff pushed a commit to RaiKoHoff/notepad2 that referenced this issue Jul 19, 2021
@zufuliu
Copy link
Owner Author

zufuliu commented May 12, 2022

Hi @bluenlive, sorry for the inconvenience, but I had renamed these IDs (both SCLEX_* and NP2LEX_*) to something that I think are more understandable in commit 06e273d. I think you may need add some entries into LexerConfig.py and KeywordUpdate.py, you can make a PR to include these changes (including auto-generated code in EditAutoC.c) to improve maintainability.

@zufuliu
Copy link
Owner Author

zufuliu commented Jun 17, 2022

Closed this issue, since commit e373f9a, resource id for scheme can be any number (except that NP2LEX_TEXTFILE should be the first).

@zufuliu zufuliu closed this as completed Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants