-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
LaTeX-insert-item problem with end of line in evil mode #5241
Comments
I agree. I'll take this one. |
try this (defun spacemacs/latex-insert-item ()
(interactive "*")
(if (evil-normal-state-p)
(progn (evil-open-below 1)
(beginning-of-line)
(call-interactively 'LaTeX-insert-item))
(call-interactively 'LaTeX-insert-item)))
(spacemacs/set-leader-keys-for-major-mode 'latex-mode
"i" 'spacemacs/latex-insert-item) |
It works great, thanks. |
if you use autocompletion layer there's a snippet bound on "-" (hyphen) for that. |
@dlebrecht thank you for the suggestion. It works with |
if that interests you, adding this to ur .spacemacs layer configuration, it
On Thu, Feb 25, 2016 at 4:21 PM, Alan Schmitt notifications@github.com
|
@dlebrecht Thanks for the hint, but I think I found another bug, which I'll report separately (done as #5259): one-letter snippets do not work, as for some reason the completion mechanism is not triggered for them. As soon as I enter two letters, I see both completions from company (usual words), and snippets. |
This is actually not LaTeX specific. This is rather a more general bug and issue with emacs in general. Since emacs is built around the idea of non-modal editing, it has no concept of modal editing. Thus, any command that acts to modify the state of the environment will do so with a "one character off" error. Making a new bullet point in org mode breaks the same way as inserting a new item does in LaTeX, for example. Anything sensitive to the position of the cursor will break this way. The easiest fix that I can think of is to have commands like |
You can set |
@TheBB I used so have that setting before switching to spacemacs. It may be nice to put it by default. |
We did have it as default for a while and it was quite contentious. |
Why? If there is a link to a discussion, I would really like to know what the problems could be with that setting. |
Very interesting read, thanks. So my understanding of the conclusion there is that we need to fix every function that relies on the character being after another character, and the fix by @justbur is the way to go. |
My interpretation of this bug report was that you were expecting this function to open up a new line below the current one, when what it actually does is insert a new line into the current line, splitting the line if the point is not at the end of of the line. My "fix" is not trying to reposition the point. It was actually rewriting the function to do something different in normal mode (open a new line below). I think it would be awful to try and manually "fix" functions by repositioning the point depending on context. |
Hi, |
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! |
Description
When using
LaTeX-insert-item
(,i
in latex,spacemacs/layers/+lang/latex/packages.el
Line 93 in f49792e
,i
Reproduction guide
,e<RET>
afoo
, then hit escape,i
Observed behaviour:
This is what we get:
Expected behaviour:
This is what we should get
System Info
Backtrace
not relevant
The text was updated successfully, but these errors were encountered: