-
Notifications
You must be signed in to change notification settings - Fork 69
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
getLexer and setLexer do not work #271
Comments
This may be of interest to you: https://community.notepad-plus-plus.org/topic/23922/new-ilexer-interface-from-pythonscript |
That feature got broken with the switch to scintilla 5.x used by N++ 8.4 and later. |
PythonScript 2 with Notepad++ v8.4.8 |
I've used this:
replace "markdown" with whatever the name of your Lexer is. Must use the naming from the
Cheers. |
@vinsworldcom I am not sure to understand which name should I use for Lexer. I mean, I do not know which is the lexer used for a file. That is why I use getLexer. To use the same lexer for the new one, as follows:
|
I tried lang = editor.getLexerLanguage() and then I tried to apply an
editor.setLexerLanguage(lang) to the new document but it does not work.
…On Wed, Jan 25, 2023 at 5:19 PM alankilborn ***@***.***> wrote:
...and PythonScript 2 does not?
From PS 2.0:
[image: image]
<https://user-images.githubusercontent.com/77065706/214617236-78719543-043b-4b69-9fd1-5acf8a6b5b51.png>
—
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK5PEE6KAR7IUMLHECPZ6DWUFHABANCNFSM6AAAAAATTCHZRQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Dario de Judicibus, Rome, Italy (EU)
Site: https://www.dejudicibus.it, https://genealogia.dejudicibus.it
Blog: https://www.lindipendente.eu
Book: https://www.lalamanera.it, https://www.lasorgentedeimondi.it
|
Where do you see Maybe this excerpt and addition from/to my example above helps:
Cheers. |
The problem is not to get the language: editor.getLexer() returns 4 for
PHP and editor.getLexerLanguage() returns 'hypertext'.
The problem is to SET the language. editor.setLexer(4) and
editor.setLexerLanguage('hypertext') do not work. They give no error but do
nothing.
On Wed, Jan 25, 2023 at 5:30 PM Dario de Judicibus ***@***.***>
wrote:
… I tried lang = editor.getLexerLanguage() and then I tried to apply an
editor.setLexerLanguage(lang) to the new document but it does not work.
On Wed, Jan 25, 2023 at 5:19 PM alankilborn ***@***.***>
wrote:
> ...and PythonScript 2 does not?
>
> From PS 2.0:
>
> [image: image]
> <https://user-images.githubusercontent.com/77065706/214617236-78719543-043b-4b69-9fd1-5acf8a6b5b51.png>
>
> —
> Reply to this email directly, view it on GitHub
> <#271 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAK5PEE6KAR7IUMLHECPZ6DWUFHABANCNFSM6AAAAAATTCHZRQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
Dario de Judicibus, Rome, Italy (EU)
Site: https://www.dejudicibus.it, https://genealogia.dejudicibus.it
Blog: https://www.lindipendente.eu
Book: https://www.lalamanera.it, https://www.lasorgentedeimondi.it
--
Dario de Judicibus, Rome, Italy (EU)
Site: https://www.dejudicibus.it, https://genealogia.dejudicibus.it
Blog: https://www.lindipendente.eu
Book: https://www.lalamanera.it, https://www.lasorgentedeimondi.it
|
THe problem occurs only for new (not yet saved) files.
On Wed, Jan 25, 2023 at 5:36 PM Dario de Judicibus ***@***.***>
wrote:
… The problem is not to get the language: editor.getLexer() returns 4 for
PHP and editor.getLexerLanguage() returns 'hypertext'.
The problem is to SET the language. editor.setLexer(4) and
editor.setLexerLanguage('hypertext') do not work. They give no error but do
nothing.
On Wed, Jan 25, 2023 at 5:30 PM Dario de Judicibus ***@***.***>
wrote:
> I tried lang = editor.getLexerLanguage() and then I tried to apply an
> editor.setLexerLanguage(lang) to the new document but it does not work.
>
> On Wed, Jan 25, 2023 at 5:19 PM alankilborn ***@***.***>
> wrote:
>
>> ...and PythonScript 2 does not?
>>
>> From PS 2.0:
>>
>> [image: image]
>> <https://user-images.githubusercontent.com/77065706/214617236-78719543-043b-4b69-9fd1-5acf8a6b5b51.png>
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#271 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AAK5PEE6KAR7IUMLHECPZ6DWUFHABANCNFSM6AAAAAATTCHZRQ>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
>
> --
> Dario de Judicibus, Rome, Italy (EU)
> Site: https://www.dejudicibus.it, https://genealogia.dejudicibus.it
> Blog: https://www.lindipendente.eu
> Book: https://www.lalamanera.it, https://www.lasorgentedeimondi.it
>
--
Dario de Judicibus, Rome, Italy (EU)
Site: https://www.dejudicibus.it, https://genealogia.dejudicibus.it
Blog: https://www.lindipendente.eu
Book: https://www.lalamanera.it, https://www.lasorgentedeimondi.it
--
Dario de Judicibus, Rome, Italy (EU)
Site: https://www.dejudicibus.it, https://genealogia.dejudicibus.it
Blog: https://www.lindipendente.eu
Book: https://www.lalamanera.it, https://www.lasorgentedeimondi.it
|
You're not understanding (or perhaps I'm not). You can no longer user To set lexers in the new API, you do not use a number. You use a pointer to the lexer name. Please look closely - the command is Please try replacing the
Cheers. |
See release notes for https://github.com/bruderstein/PythonScript/releases/tag/v2.0.0. Just N++ up to 8.3.x is supported. |
Well, I hope that some function will be developed to make easier to get and
set le ed info because the code that was proposed is really ugly if you
have to use it every time in simple script. Something similar to getLexer
and setLexer should be developed in my opinion.
On Wed, 25 Jan 2023 at 23:30 chcg ***@***.***> wrote:
See release notes for
https://github.com/bruderstein/PythonScript/releases/tag/v2.0.0. Just N++
up to 8.3.x is supported.
N++ 8.4.x contains scintilla versions 5.x with a big change how lexers are
handled. Unfortunately just pythonscript 3.0.x is updated yet to supported
N++ 8.4.x but also there the handling for settting lexers is an open issue.
If that point is fixed I'm planning to backport the changes also to the
pythonscript 2.x line.
—
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK5PEAPJCRECTNDU2HKL6DWUGSRVANCNFSM6AAAAAATTCHZRQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Dario de Judicibus, Rome, Italy (EU)
Site: https://www.dejudicibus.it, https://genealogia.dejudicibus.it
Blog: https://www.lindipendente.eu
Book: https://www.lalamanera.it, https://www.lasorgentedeimondi.it
|
It looks like it is not possible anymore to use setLexer to set a language in Notepad++. Scintilla 5 has moved the lexers from Scintilla into a new Lexilla project.
For example, the following code DOES duplicate a file but DOES NOT set its language as the same of original one.
The text was updated successfully, but these errors were encountered: