Giter Club home page Giter Club logo

enhanced-ruby-mode's People

Contributors

jacott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

enhanced-ruby-mode's Issues

Indentation settings

I don't seem to get the indentation to work as I want it to.

I want this:

test = {
  a: 1,
  b: 2,
  c: {
    d: 4
  }
}

I always get this:

test = {
        a: 1,
        b: 2,
        c: {
            d: 4
           }
        }

Even after setting:

(setq ruby-deep-arglist t)
(setq ruby-deep-indent-paren nil)
(setq ruby-hanging-indent-level 2)

Am I doing something wrong? Or are those settings simply ignored?

Render failed when (setq vc-follow-symlinks t) and then open a symlinked file.

1. start emacs with only following config;

(setq vc-follow-symlinks t)
(require 'enh-ruby-mode)
(setq enh-ruby-program "my/1.9/ruby/pah")
(add-to-list 'interpreter-mode-alist '("ruby" . enh-ruby-mode))

open ~/.irbrc. this file is a symlinked file which link to other place.

get error:

error in process filter: save-current-buffer: Selecting deleted buffer
error in process filter: Selecting deleted buffer

Thanks.

sexp movement is off by one

Start with the following code:

f(1, 2, 3)

with your cursor at 0. Hit M-SPC, M-f, C-w and you SHOULD have selected the whole function call and killed it. But you're left with ")".

Likewise:

f 42 do
  g
end

Puts M-f across the do puts the cursor at the beginning of end, not one character past it.

Problem with ruby-electric

If I open an empty file and try to insert a new line with ruby-electric, I get

Debugger entered--Lisp error: (error "expression ends prematurely")
  signal(error ("expression ends prematurely"))
  error("expression ends prematurely")
  ruby-backward-sexp(1)
  ruby-electric-return-can-be-expanded-p()
  ruby-electric-return()
  call-interactively(ruby-electric-return nil nil)

If I type def followed by an empty space, I get a wrongly indented end:

# Input: def SPC
def 
  end

Also within a class body, every time I press enter a new end is added:

# Input: class RET RET RET
class



end
end
end

My guess is that the culprit is ruby-backward-sexp.

slowness on newline

love the mode, but I am finding when I make a newline (hit enter), there is a noticeable pause. strange, because I don't get any slowdown when doing any other kind of edit.

Bug: Deep indentation for params is off by 1

indentation is SO much better then official ruby-mode it is like a dream. The one issue I have noticed is if you type out this line

blah = foo(bin: 1,
          baz: 2)

you will see when you hit enter, the b in baz is lined up with the open paren of the arg list. If you indent the second line, it lines up fine, and if the whole line exists first and you hit enter right after the comma, it also indents fine.

ruby-end-of-defun does not work

If I run M-x ruby-end-of-defun in this file, where | is the position of the cursor:

def te|st
  "test"
end

The cursor ends up here:

def test
  "test"
|end

Instead of here:

def test
  "test"
end|

Even worse, if I run it at this position:

def test
  "test"
e|nd

Then the CPU usage goes up to 100% and emacs is frozen in an infinite loop.

Feature Request: More fine grained control over warnings

I love warnings, but one thing that is bugging me is that in rspec, this is how you do an assertion

foo.should == 1

you get as a warning

warning: possibly useless use of == in void context

I would rather have that then turn them off altogether, but it would be cool if there were some way to squelch certain warnings in certain buffers.

no implicit conversion from nil to integer

ERM sometimes freezes, and I get the following in /tmp/erb.log:

"p16:1:991:835:0:}\n\u0000\u0000\u0000\n"
no implicit conversion from nil to integer
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:68:in `[]'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:68:in `realadd'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:30:in `nadd'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:47:in `add'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:332:in `on_rbrace'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:423:in `parse'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:423:in `block in parse'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:422:in `catch'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:422:in `parse'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm_buffer.rb:528:in `parse'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm.rb:45:in `block in <main>'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm.rb:26:in `open'
/Users/Jell/.emacs.d/el-get/Enhanced-Ruby-Mode/ruby/erm.rb:26:in `<main>'

So I'm guessing that ErmBuffer does not know about the p command.

Conflicts With YASnippet

I simply love this mode and really want to use it all the time, but inserting snippets with YASnippet trips it up. Somehow, the initial snippet is not pushed down to the buffer. Because of that, the next change made indexes into the buffer string in bad spots. The parser recovers after the error, but the error is enough to cancel YASnippet's expansion, so they really don't peacefully coexist.

Ideally, it would be awesome to find a way to push down the YASnippet changes as they happen. If we can do that, this mode could keep parsing all the way through snippet expansion.

Another less ideal option is that YASnippet gives us before and after hooks. Is there someway I can disable the parser before expansion, then kick it back in after (somehow flushing the current buffer content to it)?

this breaks haml-mode

Messages Buffer shows

Error during redisplay: (void-variable ruby-font-lock-keywords) [2 times]

it used to work with default ruby-mode (from upstream ruby source)

Custom keywords

With ruby-mode I was able to do something like this: (font-lock-add-keywords 'ruby-mode '(("\\<\\(require_relative\\|require\\|include\\|extend\\)\\>" . font-lock-keyword-face)))

But not in erm. It looks like it is working just for a seconds - when I edit buffer the font color changes but just after a second it goes back to default.

Is it possible to add custom keywords in erm?

inferior-ruby-mode: Symbol's function definition is void: ruby-mode-variables

When using Enhanced-Ruby-Mode with the latest official ruby-mode from the svn trunk, I get the following error when executing M-x run-ruby:

inferior-ruby-mode: Symbol's function definition is void: ruby-mode-variables

The *ruby* buffer is still created and irb is loaded, but Emacs does not automatically display the buffer. When Enhanced-Ruby-Mode is not being used, this error does not occur.

Feature Request: Moar Faces

I love that you have string delimiters and operators, some things I would like to see (and would customize) are

  • square brackets []
  • parens ()
  • brace brackets {}
  • dots .
  • colons :

I like to make dots, colons, and parens fade into the background a bit (makes things look kind of smalltalk-ish), and give different colors for arrays and hashes

syntax highlighting seems to bork all other highlighting

I use whitespace-mode and my own highlighter for HACK/FIX/REFACTOR/etc tags and they're drowned out by your mode's highlighting. You can occasionally see blank-mode flickering and then getting overwritten.

I don't know modes/faces well enough to debug this.

My whitespace (customize) setup:

 '(whitespace-global-modes (quote (ruby-mode emacs-lisp-mode scheme-mode)))
 '(whitespace-style (quote (face tabs trailing lines-tail space-before-tab empty))))

This should work out of the box with 24... possibly 23 as well. Make a ruby file with a long line or mix in tabs and you should see extra highlighting with normal ruby mode but not on ERM.

Don't Hardcode Syntax Colors

Syntax highlighting should be done based on my chosen theme. You have hardcoded colors in here, goldenrod for example.

Syntax Highlighting and Indenting Not Working

I can not get syntax highlighting nor indenting to work in enh-ruby-mode. It works fine in ruby-mode, but when enh-ruby-mode is turned on everything is just black text, and auto indent stops working. I am running emacs 24.4.1 on Debian Wheezy, and I installed version 20150312.1458 of enh-ruby-package from melpa archive.

screenshot from 2015-04-06 23 22 07

~/.emacs.d/init.el

(load "package")
(package-initialize)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)

;; Installs version 20150312.1458 of enh-ruby-package from melpa
(package-refresh-contents)
(package-install 'enh-ruby-mode)

(add-to-list 'load-path "(path-to)/Enhanced-Ruby-Mode") ; must be added after any path containing old ruby-mode
(autoload 'enh-ruby-mode "enh-ruby-mode" "Major mode for ruby files" t)
(add-to-list 'auto-mode-alist '("\\.rb$" . enh-ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . enh-ruby-mode))

UTF-8 breaks syntax highlighting

Hi there,

Having a file including UTF-8 characters breaks syntax highlighting.

If I create a file "test.rb" as follows:

# -*- coding: utf-8 -*-
"testöåä"

And try to open it, the code won't be highlighted.

Trying to run M-x ruby-mode returns erm-ruby-get-process: No catch for tag: interrupted, t in the Message buffer.

(void-function flymake-delete-own-overlays)

After updating to the last version of ERM, I get this:

Debugger entered--Lisp error: (void-function flymake-delete-own-overlays)
  flymake-delete-own-overlays()
  erm-syntax-response("\n\n")
  erm-parse("c\n\n")
  erm-filter(#<process erm-ruby-process> "c\n\n\n\n")
  accept-process-output(#<process erm-ruby-process> 0.5)
  erm-wait-for-parse()
  ruby-indent-line()
  indent-according-to-mode()
  evil-ret(nil)
  call-interactively(evil-ret nil nil)

Incorrect parsing / indention

Benchmark::bm(20) do |x|
  x.report("null_time") do
    for i in 0..max do
        # do nothing
      end
    end

    x.report("benchmark-1") do
      for i in 0..max do
          # insert code here
        end
      end

      x.report("benchmark-2") do
        for i in 0..max do
            # insert code here
          end
        end
      end

Is this repository still maintained?

I see no activities and old unresolved issues, has the main project moved to the zenspider's fork?

If so, updating the readme would be great, if not, what gives?

Color of operators differ from color in default ruby-mode

Hello!

At first: thank for this great mode! This mode solved for me problem with syntax highlighting inside %{} when there was different kind of quotes. See screens: default ruby mode, enhanced ruby mode. And here is our discussion about this.

But I have one more question: why color of operators (<, +, =) have changed? You could see changes on screens mentioned above.

Full my emacs config available here: https://github.com/yas375/emacs-config

Thanks in advance! =)

ruby-mode is not a good name

Python has had this problem for a while, with two conflicting modes both using python-mode as their name. Don't fall into the same trap, please.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.