why is my array a hash?

  • Thread starter Lady Michelle Bhaal
  • Start date
L

Lady Michelle Bhaal

I have a chunk of code, where I define an array, and the very next time
I use it, Ruby thinks that it's a hash instead :(

...
step = Array.new
astep, line = getNextWord(line)
while astep != nil
{
step.push(astep) <- gets error 'odd number list for hash'
astep, line = getNextWord(line)
}
...

What's with this?

Michelle :)
 
L

Lady Michelle Bhaal

Thanks, now if I could only teach Vim to match do,end pairs the way
it'll match braces
 
W

Wybo Dekker

Lady Michelle Bhaal said:
Thanks, now if I could only teach Vim to match do,end pairs
the way it'll match braces

Funny you should mention that... :)

If you drop the $VIMRUNTIME/macros/matchit.vim file in your
~/.vim/plugins/, enable filetype plugins support in your vimrc,
and install the latest vim-ruby package from
<http://vim-ruby.rubyforge.org/>, you'll have just that!

Detailed instructions on this can be found at the bottom of this
page: http://tinyurl.com/avfzf [rubyforge.org cvs].

This says:
the :help works, but the % does not

this says:

E121: Undefined variable: b:match_words
E15: Invalid expression: b:match_words

what's wrong? My vim is version 6.3.23 and my .vimrc has:

set nocompatible " We're running Vim, not Vi!
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
 
W

Wybo Dekker

It looks like either matchit.vim is not being loaded (is it in
your ~/.vim/plugin/ directory?) or ftplugin/ruby.vim isn't
being loaded.

It *is* loaded - I tested that by introducing an error (iif instead of if)
in the matchit.vim file, and that was detected:

Error detected while processing /home/wybo/.vim/plugin/matchit.vim:
line 40:
E492: Not an editor command: iif exists("loaded_matchit") || &cp
Hit ENTER or type command to continue

In my ~/.vim I have:

/doc:
total 24
-rw-r--r-- 1 wybo users 18998 20040512 16:28:33 matchit.txt
-rw-r--r-- 1 wybo users 1961 20051119 13:29:28 tags

/plugin:
total 32
-rw-r--r-- 1 wybo users 30374 20040515 17:10:28 matchit.vim

/syntax:
total 8
-rw-r--r-- 1 wybo users 1119 20050705 06:58:57 eruby.vim
-rw-r--r-- 1 wybo users 4081 20051119 13:26:41 ruby.vim

Is that correct?
 
W

Wybo Dekker

Apologies if this is a stupid question, but... with the setup
you describe above, and with the active buffer being a correctly
identified ruby file, does the `:echo b:match_words` test work?

no, it doesn't; :se syntax says syntax=ruby and :echo b:match_words
says

E121: Undefined variable: b:match_words
E15: Invalid expression: b:match_words
If you still have trouble, try asking on the vim-ruby-devel ML,
found at <http://rubyforge.org/mail/?group_id=16>.

I'll do that, this is getting away from ruby too much... thanks sofar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,040
Members
47,634
Latest member
RonnyBoelk

Latest Threads

Top