editor.WordChars not acessable in Scite 3.2 and error-bug

59 views
Skip to first unread message

Frank Wunderlich

unread,
Jun 8, 2012, 6:09:57 AM6/8/12
to scite-i...@googlegroups.com
hi,
i have a script using editor.WordChars. i think its not a feature from
Scite-RU and i tried it in GSciTE 3.2.
i get the following error:
..ome/frank/.scite/lua/highlighting_identical_text.lua:98: Pane function
/ readable property / indexed writable property name expected
which points to this line:
word_pattern = '[^' .. editor.WordChars .. ']'
where word_pattern is a local var, so the error can only thrown by
editor.WordChars

because of the dots in front of the path, i can't open the file directly
by doubleclick. changing it to /home/frank works.

Regards Frank

Philippe Lhoste

unread,
Jun 8, 2012, 7:16:11 AM6/8/12
to scite-i...@googlegroups.com
On 08/06/2012 12:09, Frank Wunderlich wrote:
> i have a script using editor.WordChars. i think its not a feature from Scite-RU and i
> tried it in GSciTE 3.2.
> i get the following error:
> ..ome/frank/.scite/lua/highlighting_identical_text.lua:98: Pane function / readable
> property / indexed writable property name expected
> which points to this line:
> word_pattern = '[^' .. editor.WordChars .. ']'
> where word_pattern is a local var, so the error can only thrown by editor.WordChars

WordChars is a write-only property, a setter.
You can see that in the iFaceTable.cxx file, among others.

Possible workaround: read directly the property from SciTE. For example:

-- The property set specifically in lua.properties
print('lua', props['word.chars.lua'])
-- The more generic property,
-- but doesn't work for multiple extensions (eg. $(file.patterns.cpp))
local ext = string.lower(props["FileExt"])
print(ext, props['word.characters.*.' .. ext])

Neil Hodgson

unread,
Jun 8, 2012, 6:43:45 PM6/8/12
to scite-i...@googlegroups.com
Philippe Lhoste:

WordChars is a write-only property, a setter.

Frank Wunderlich

unread,
Jun 9, 2012, 4:13:24 AM6/9/12
to scite-i...@googlegroups.com
Phillips workaround works. Thank you.
Is there an easier way i can read them based on this patches?
Regards frank
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.



Neil Hodgson <nyama...@me.com> schrieb:

--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-i...@googlegroups.com.
To unsubscribe from this group, send email to scite-interes...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.

Neil Hodgson

unread,
Jun 10, 2012, 10:11:29 PM6/10/12
to scite-i...@googlegroups.com
Frank Wunderlich:

> Is there an easier way i can read them based on this patches?

If you have built with the patch then editor:GetWordChars() will return the word characters.

Neil

Philippe Lhoste

unread,
Jun 11, 2012, 4:16:52 AM6/11/12
to scite-i...@googlegroups.com
On 09/06/2012 00:43, Neil Hodgson wrote:
> Philippe Lhoste:
>
>> WordChars is a write-only property, a setter.
>
> This was changed recently (post 3.2.0) with these feature requests:

Good, because I saw no reasons we couldn't get the info back, and my workaround was too
dependent on the way the property was built for the current lexer.

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

Frank Wunderlich

unread,
Jun 11, 2012, 1:38:03 PM6/11/12
to scite-i...@googlegroups.com
Neil Hodgson, 11.06.2012 04:11:
> If you have built with the patch then editor:GetWordChars() will
> return the word characters. Neil
i haven't build it manually...i have the 3.02 binaries from scintilla.org...
i thought the patches are applied already...if i understand you right,
the patches are only applied in svn/hg

ok, so i work with the workaround and wait for the next version...

but why making editor.WordChars not readable and implementing a new method?

regards Frank

Neil Hodgson

unread,
Jun 11, 2012, 7:56:24 PM6/11/12
to scite-i...@googlegroups.com
Frank Wunderlich:

> i thought the patches are applied already...if i understand you right, the patches are only applied in svn/hg

As I said: "post 3.2.0".

> ok, so i work with the workaround and wait for the next version...
>
> but why making editor.WordChars not readable and implementing a new method?

The code generator (scite/scripts/IFaceTableGen.py) that wraps the Scintilla API for Lua doesn't understand simple readable string properties so wraps it as a function.

Neil

Frank

unread,
Sep 9, 2012, 12:33:20 PM9/9/12
to scite-i...@googlegroups.com
in scite 3.02 (last scite_ru) props['word.characters.*.'..ext] is always empty and editor:GetWordChars() is not accesable

what i'm doing wrong?

Frank Wunderlich

unread,
Sep 9, 2012, 3:32:51 PM9/9/12
to scite-i...@googlegroups.com
btw. scite 3.2.2 for gtk does not know editor:GetWordChars() ...is there
no way to work for both versions (3.0.2 on windows,3.2.2 on gtk)?

Philippe Lhoste

unread,
Sep 10, 2012, 5:50:43 AM9/10/12
to scite-i...@googlegroups.com
On 09/09/2012 21:32, Frank Wunderlich wrote:
> btw. scite 3.2.2 for gtk does not know editor:GetWordChars() ...is there no way to work
> for both versions (3.0.2 on windows,3.2.2 on gtk)?

In Lua for SciTE, getters become kind of properties:

print(editor.WordChars)
Reply all
Reply to author
Forward
0 new messages