Skip to content
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

Error when expanding folders #43

Open
Zauberfisch opened this issue Jun 28, 2014 · 7 comments
Open

Error when expanding folders #43

Zauberfisch opened this issue Jun 28, 2014 · 7 comments

Comments

@Zauberfisch
Copy link

ctrl+shift+p => Create Xiki Buffer

I tried to expand a folder that was outputted by ls and got the following error:

$ ls
  User
    - tried to run: Ls.menu "User"
    - error: undefined method `goto_char' for nil:NilClass
    - backtrace:
      @/home/zauberfisch/test/xiki/lib/xiki/core/view.rb:1039:in `cursor='
      @/home/zauberfisch/test/xiki/lib/xiki/core/tree.rb:784:in `rescue in construct_path'
      @/home/zauberfisch/test/xiki/lib/xiki/core/tree.rb:728:in `construct_path'
      @/home/zauberfisch/test/xiki/lib/xiki/core/tree.rb:1927:in `path'
      @/home/zauberfisch/test/xiki/lib/xiki/core/tree.rb:1825:in `file'
      @/home/zauberfisch/test/xiki/menu/ls.rb:16:in `menu'
      @/home/zauberfisch/test/xiki/lib/xiki/core/invoker.rb:168:in `call'
      @/home/zauberfisch/test/xiki/lib/xiki/core/invoker.rb:168:in `block in invoke'
      @/home/zauberfisch/test/xiki/lib/xiki/core/code.rb:277:in `module_eval'


###############
# system info #
###############

$ ruby -v
  ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

$ uname -a
  Linux __HOSTNAME__ 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ subl --version
  Sublime Text Build 3059
@Zauberfisch
Copy link
Author

also getting a (different) error expanding on other folders, such as:

$ ls /home/zauberfisch
  Desktop
    undefined local variable or method `dir' for Xiki::DirHandler:Class
    /home/zauberfisch/test/xiki/lib/xiki/handlers/dir_handler.rb:12:in `handle'
    /home/zauberfisch/test/xiki/lib/xiki/core/menu.rb:1170:in `block in handle'
    /home/zauberfisch/test/xiki/lib/xiki/core/menu.rb:1167:in `each'
    /home/zauberfisch/test/xiki/lib/xiki/core/menu.rb:1167:in `handle'
    /home/zauberfisch/test/xiki/lib/xiki/core/menu.rb:1066:in `expand_menufied'
    /home/zauberfisch/test/xiki/lib/xiki/core/menu.rb:1002:in `expand'
    /home/zauberfisch/test/xiki/lib/xiki/core/expander.rb:238:in `block in expand'
    /home/zauberfisch/test/xiki/lib/xiki/core/expander.rb:236:in `each'
    /home/zauberfisch/test/xiki/lib/xiki/core/expander.rb:236:in `expand'
    /home/zauberfisch/test/xiki/lib/xiki/core/menu_suggester.rb:100:in `expand'
    /home/zauberfisch/test/xiki/lib/xiki/core/expander.rb:238:in `block in expand'
    /home/zauberfisch/test/xiki/lib/xiki/core/expander.rb:236:in `each'
    /home/zauberfisch/test/xiki/lib/xiki/core/expander.rb:236:in `expand'
    /home/zauberfisch/test/xiki/lib/xiki.rb:446:in `[]'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:45:in `block (3 levels) in run'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:20:in `loop'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:20:in `block (2 levels) in run'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:19:in `open'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:19:in `block in run'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:18:in `open'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:18:in `run'
    /home/zauberfisch/test/xiki/etc/command/xiki_process.rb:68:in `<top (required)>'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons/application.rb:203:in `load'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons/application.rb:203:in `start_load'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons/application.rb:298:in `start'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons/controller.rb:70:in `run'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons.rb:147:in `block in run'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in `call'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons/cmdline.rb:109:in `catch_exceptions'
    /var/lib/gems/1.9.1/gems/daemons-1.1.9/lib/daemons.rb:146:in `run'
    /home/zauberfisch/test/xiki/etc/command/xiki_command.rb:111:in `run'
    /home/zauberfisch/test/xiki/bin/xiki:34:in `<top (required)>'
    /usr/bin/xiki:2:in `load'
    /usr/bin/xiki:2:in `<main>'

  Documents
  Downloads
  Music
  ...

@Zauberfisch
Copy link
Author

I have not tried to use xiki in any other editor, if this is bug is actually a bug of xiki itself, please let me know and I will repost the issue there.

@lunixbochs
Copy link
Owner

SublimeXiki has a very minimal approach to integration. When I originally integrated, I didn't see a good way to run commands through Xiki, so I implemented it myself in Sublime (which allowed me to do nice async output). This means commands like ls don't work the same way as inside Xiki. It might be a simple change to pass nested command invocations through Xiki, but I haven't looked at the xiki command specs in forever.

An easy solution to the ls problem is to use the native folder navigation - just skip $ ls and invoke paths directly.

@Zauberfisch
Copy link
Author

wait, so are you saying this is a re-implementation of xiki?

@lunixbochs
Copy link
Owner

No. There's a Xiki command-line interface. It didn't give me a good way to do things like directory trees and executing shell commands, so I wrote that part myself. All of the errors you saw before are output from the Xiki command-line interface. I don't know how the nested command feature works inside Xiki.

@Zauberfisch
Copy link
Author

I see,
well, your suggestion using just the path works.
and I am not sure how much I will actually use SublimeXiki, so I not to overly atteched to this,
but it still is a bug that should be fixed ;)

@joenorton
Copy link

Ah, I just posted this as an issue on the main Xiki repo.

This directory not working business is pervasive in the menus. It really needs to be fixed.

I can't even run through the example command: docs
without running into the bug

  @open file//Users/joenorton/menu/docs.txt
    undefined local variable or method `dir' for Xiki::DirHandler:Class
    /Users/joenorton/xiki/lib/xiki/handlers/dir_handler.rb:12:in `handle'
    /Users/joenorton/xiki/lib/xiki/core/menu.rb:1170:in `block in handle'

see this gist: https://gist.github.com/joenorton/639221efab83ad505add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants