jEdit Community - Resources for users of the jEdit Text Editor
Template Accelerators - Keywords beginning with @ and other special chars
Submitted by WarrickF on Thursday, 1 May, 2008 - 13:39
Hi all, I'm having a problem setting up Keywords in Accelerator that begin with "@" and other special chars like "<". If I setup an accelerator called Test - all is good, if I name my accelerator @Test it does not work. The help says .... The plugin searches for the keyword from the current caret position in the textarea backwards to first whitespace character. However is seem like it only searches backward for char 1..9,a..z,A..Z Is this a bug or is there some workaround like escaping the char somehow (which I've tried)? Thanks Warrick
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Buffer-Local Property "noWordSep"
by Robert Schwenn on Thu, 01/05/2008 - 21:28
It turns out that the help seems not to be correct. It should be written "searches ... backwards to the beginning of the word (resp. the first non-word character)".

A "word" is a string that contains only alphanumeric characters (0-9 and a-Z) and also configured "Extra Word Characters" - see What's a Word . Configuring is done via "Global Options - Editing - Extra Word Characters".

In addition "Extra Word Characters" can be set via the Buffer-Local Property "noWordSep". That means, if You place the string ":noWordSep=@:" in the first or last 10 lines of a buffer, the "@" character will be a word character for this buffer - see Buffer-Local Properties .

Robert
 
Thanks Robert - that's very h
by WarrickF on Fri, 02/05/2008 - 14:35
Thanks Robert - that's very helpful. I think there must be something else going on though because:

- Tried adding the ":noWordSep=@:" to the local buffer and the search still stops short of the character.

- I added @ as an extra word character to my global settings and the search still stops short of the character.

- I tried restarting etc. to make sure it wasn't some form of cache, but that didn't seem to help either.

Your answer seemed very logical though, so I'm wondering if the plugin doesn't have this hard coded somehow, which ultimately ignored the word definition?
 
Tested with @
by Robert Schwenn on Fri, 02/05/2008 - 15:01
I tested the behavior with "@" before I wrote my last comment. It works perfectly. I just tested it again.

What versions are You using? I use:

jEdit 4.3pre14
Templates plugin 4.1.1
SUN JRE 1.6.0_05
Windows XP SP2
User login
Browse archives
« November 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300