Code Monkey home page Code Monkey logo

Comments (7)

manateelazycat avatar manateelazycat commented on June 1, 2024

先用 M-x toggle-debug-on-error 打开调试选项,再复现后,把 backtrace 的内容粘贴一下。

感谢反馈!

from awesome-tab.

shuxiao9058 avatar shuxiao9058 commented on June 1, 2024

先用 M-x toggle-debug-on-error 打开调试选项,再复现后,把 backtrace 的内容粘贴一下。

感谢反馈!

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-to-number(nil)
  awesome-tab-select-visible-tab()
  funcall-interactively(awesome-tab-select-visible-tab)
  call-interactively(awesome-tab-select-visible-tab nil nil)
  command-execute(awesome-tab-select-visible-tab)

from awesome-tab.

manateelazycat avatar manateelazycat commented on June 1, 2024
(defun awesome-tab-select-visible-tab ()
  "Bind this function with number keystroke, such as s-1, s-2, s-3 ... etc.

This function automatically recognizes the number at the end of the keystroke
and switches to the tab of the corresponding index.

Note that this function switches to the visible range,
not the actual logical index position of the current group."
  (interactive)
  (let* ((event last-command-event)
         (key (make-vector 1 event))
         (key-desc (key-description key)))
    (message "%s" key-desc)
    (awesome-tab-select-visible-nth-tab
     (string-to-number (nth 1 (split-string key-desc "-"))))))

你把上面的代码执行一下,然后再按键,看看 minibuffer 显示 key-desc 是啥?

from awesome-tab.

shuxiao9058 avatar shuxiao9058 commented on June 1, 2024

M-1的时候key-desc是1,但是还是报错。

from awesome-tab.

shuxiao9058 avatar shuxiao9058 commented on June 1, 2024

如下所示是正常的

  (defun awesome-tab-select-visible-tab ()
    "Bind this function with number keystroke, such as s-1, s-2, s-3 ... etc.

This function automatically recognizes the number at the end of the keystroke
and switches to the tab of the corresponding index.

Note that this function switches to the visible range,
not the actual logical index position of the current group."
    (interactive)
    (let* ((event last-command-event)
           (key (make-vector 1 event))
           (key-desc (key-description key)))

      (awesome-tab-select-visible-nth-tab
       (string-to-number (or (nth 1 (split-string key-desc "-")) key-desc)))))

from awesome-tab.

manateelazycat avatar manateelazycat commented on June 1, 2024

最新版应该已经修复了。

from awesome-tab.

shuxiao9058 avatar shuxiao9058 commented on June 1, 2024

现在没问题了,多谢 ~

from awesome-tab.

Related Issues (20)

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.