Author Topic: Meaning of "Next Word" is inconsistent  (Read 2648 times)

brebey

  • Community Member
  • Posts: 58
  • Hero Points: 2
Meaning of "Next Word" is inconsistent
« on: May 08, 2012, 02:20:06 am »
Re: SlickEdit 12.x and 16.x (they act the same way), I can't figure out what's controlling the semantics of "next-word".  I've messed with the "Word Characters" in "Tools|Options|Languages|File Extension Manager|Language Setup", but without any luck, and it's really costing me a lot of extra time and keystrokes.  Help is immensely appreciated! This is making me crazy.

Specifically, when editing one .vb file, "next-word" behaves dramatically differently (and much worse) than it does with a different .vb file.  I'd like to learn to configure this so that it works consistently and per my preference.

With "Word Chars" set to "A-Za-z0-9_$", if I start at the beginning of the example line below and repeatedly hit "Ctrl-Right" (which is bound to "next-word"), the cursor jumps to the locations indicated by the red characters:

someFile.vb (undesirable)
result = .MyMethodName(123, "&String", otherArg)

anotherFile.vb (close, but still not quite right - missed the second comma)
result = .MyMethodName(123, "&String", otherArg)

What on earth could be causing one .VB file to behave so much differently than antoher .VB file??  Any thoughts on how to bring this under control?
 

Graeme

  • Senior Community Member
  • Posts: 2702
  • Hero Points: 336
Re: Meaning of "Next Word" is inconsistent
« Reply #1 on: May 09, 2012, 02:55:28 am »
Is it possible that the document mode is different for the two files  - check what language mode is selected for the two files on the Document menu.

Try running slickedit with a brand new configuration folder and see if you get the same behavior.  To do this, use the -sc switch when you start slick
vs.exe +new -sc  "some-new-empty-folder"

I have a macro called cursor_to_next_token that might do what you want  - except that in your second example, it would stop on the ampersand before String, as well as the second comma.

As far as I can see, slick doesn't have any options that could give you the behavior in the second example  - and it's not consistent in what it does for that example  - so maybe your system is malfunctioning somehow.  If using a new configuration folder gives you consistent behavior, you could try exporting all your options from your old config folder and import to the new one.

brebey

  • Community Member
  • Posts: 58
  • Hero Points: 2
Re: Meaning of "Next Word" is inconsistent
« Reply #2 on: May 15, 2012, 07:10:53 pm »
Thanks for the pointers, Graeme.  Your next-token script sounds PERFECT, though!  That's exactly what I expect "next word" to do.  Would you mind posting the source here?

brebey

  • Community Member
  • Posts: 58
  • Hero Points: 2
Re: Meaning of "Next Word" is inconsistent
« Reply #3 on: June 05, 2012, 06:39:22 pm »
This is REALLY kicking my productivity in the tail.  If anyone can help me with this problem, I'd sure appreciate it.

In a nutshell, when I'm editing VB files, and I hit my "next-word" key (Ctrl-RightArrow, for me), it doesn't stop at punctuation as expected, which makes it impossible to select a word to copy/paste.  For instance, if I drop an anchor on the first character of "MyMethod("Args")", and hit Ctrl-Right, intending to select 'MyMethod', what I get instead is 'MyMethod("'

I'd really appreciate any insight as to how to control what "next-word" does.  My original post has more detail. 


hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Meaning of "Next Word" is inconsistent
« Reply #4 on: June 05, 2012, 08:42:58 pm »
You could try setting the internal config. variable 'def_vcpp_word' to 1.
Although not documented it's supported since a long time and won't disappear.
Use 'Macros>Set Macro Variable:def_vcpp_word' or 'set-var def_vcpp_word' on SE cmdline.
Maybe it provides the expected behaviour. BTW: Which emulation ? Brief, CUA ?
Good luck, HS2