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

react-layer: tern-mode is on, when press TAB to indent it will open a helm-completion-at-point window. #7017

Closed
linchen2chris opened this issue Sep 4, 2016 · 10 comments

Comments

@linchen2chris
Copy link

Description :octocat:

react-layer: tern-mode is on, when press TAB to indent it will open a helm-completion-at-point window.

Reproduction guide 🪲

  • Start Emacs
  • add react layer
  • edit a js file
  • write some code like
    function a () {
        //this point press tab to indent
    }
  • get a helm-nil or helm-completion-at-point window.

Observed behaviour: 👀 💔
press tab get a annoying window helm-nil or helm-completion-at-point. I have to close the window use escape

Expected behaviour: ❤️ 😄
actually, I just want to indent the empty line.

System Info 💻

  • OS: gnu/linux
  • Emacs: 24.5.1
  • Spacemacs: 0.105.22
  • Spacemacs branch: develop (rev. 622938c)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: hybrid
  • Completion: helm
  • Layers:
(csv helm ivy syntax-checking
     (auto-completion :variables auto-completion-return-key-behavior 'complete auto-completion-tab-key-behavior 'cycle auto-completion-complete-with-key-sequence nil auto-completion-enable-help-tooltip t auto-completion-enable-sort-by-usage t auto-completion-enable-snippets-in-popup t)
     (ibuffer :variables ibuffer-group-buffers-by 'projects)
     java javascript ycmd org markdown react git python
     (version-control :variables version-control-diff-tool 'diff-h1 version-control-global-margin t)
     emacs-lisp
     (shell :variables shell-default-height 30 shell-default-position 'bottom))

Backtrace 🐾

@NJBS
Copy link
Contributor

NJBS commented Sep 5, 2016

You likely want to customize tab-always-indent.

tab-always-indent is a variable defined in `indent.el'.
Its value is complete

Documentation:
Controls the operation of the TAB key.
If t, hitting TAB always just indents the current line.
If nil, hitting TAB indents the current line if point is at the left margin
or in the line's indentation, otherwise it inserts a "real" TAB character.
If `complete', TAB first tries to indent the current line, and if the line
was already indented, then try to complete the thing at point.

Some programming language modes have their own variable to control this,
e.g., `c-tab-always-indent', and do not respect this variable.

@linchen2chris
Copy link
Author

I have tried this, I add

(tab-always-indent t)

to .spacemacs.
the Helm Nil window still will appear when I press tab.

@NJBS
Copy link
Contributor

NJBS commented Sep 5, 2016

I'm unable to reproduce your issue when tab-always-indent is set to t.

Perhaps some other part of your configuration is causing a conflict. Can you try reproducing with a clean .spacemacs with only the react, javascript, and auto-completion layers enabled and just the following in your dotspacemacs/user-config?

(setq tab-always-indent t)

You can verify that the value is properly set using SPC h d v.

@linchen2chris
Copy link
Author

I notice that,
I find that I config the tab-always-indent as 't' in customize, when I restart spacemacs , it value will go back as '' Indent, or if already indented complete',
it is odd! confusing....

@linchen2chris
Copy link
Author

I have clean .spacemacs. only add react and auto-completion layers

@TheBB
Copy link
Collaborator

TheBB commented Sep 5, 2016

Set the varibale in dotspacemacs/user-config, not in complete. Otherwise the Spacemacs default will override it.

@linchen2chris
Copy link
Author

even I set tab-always-indent to t in dotspacemacs/user-config, it will be overrided by Spacemacs when it restart.
I notice that in auto-complete layer the package.el has set setq tab-always-indent 'complete.
I edit package.el setq tab-always-indent t it work correctly now

@TheBB
Copy link
Collaborator

TheBB commented Sep 6, 2016

In the auto-completion layer that variable is set during the init phase, which means that dotspacemacs/user-config runs after.

@TheBB
Copy link
Collaborator

TheBB commented Sep 7, 2016

I just tried and I was able to set it in user-config. Can you show me the code you are using?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@lebensterben lebensterben removed the stale marked as a stale issue/pr (usually by a bot) label Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants