Comments (18)
Ok. So I am keeping same state regardless of the state. We can change that anytime. Just let me know if you have any problems.
from polymode.
Just a note, this ins't a markdown issue only:
#+begin_src R
x <- rnorm(100)
plot(density(x))
#+end_src
Editing the first line with $
a
delete
delete
doesn't delete this text as expected.
from polymode.
I think it's because if you are in insert state in one chunk of the file, and in normal state in another, switching from one chunk to the other will cause a change of evil state. Thus, instead of issuing your normal navigation commands, it will self insert the key you are typing.
So ideally, the evil state should be shared among all buffers displayed in a polymode document.
from polymode.
@lionelgit is there a way to tweak polymode to tell it to share evil state among buffers? This issue is quite irritating :-)
from polymode.
there is certainly a way but someone has to write it :)
Le 24 oct. 2014 à 19:49, Vince Buffalo [email protected] a écrit :
@lionelgit https://github.com/lionelgit is there a way to tweak polymode to tell it to share evil state among buffers? This issue is quite irritating :-)
—
Reply to this email directly or view it on GitHub #41 (comment).
from polymode.
I just want to update this — there is also a very bad bug whereby evil-mode with undo-tree will absolutely lead to a destruction of your undo history when used with poly-mode. Undo will quickly insert gibberish in buffers in polymode and the lack of a working undo only makes this work. Beware!
from polymode.
I also had this problem but didn't know it was caused by undo-tree. I lost data a few times. Thanks for the information!
from polymode.
Is there any update on this?
from polymode.
Not really. Sorry. There are too many non-trivial issues to deal with and I haven't had time to get into it as yet. But I will surely do, sooner or later.
from polymode.
Although it's for a different package, it looks like this is the idea: https://github.com/tarao/multi-mode-util/blob/master/multi-mode%2Bevil.el
from polymode.
it would be very nice for someone to write such a package, tough I don't have time to write one in the foreseeable future.
This package could also provide the following text objects for chunks:
(defun polymode-mark-inner-chunk ()
(let ((span (pm/get-innermost-span)))
(set-mark (1+ (nth 1 span)))
(goto-char (1- (nth 2 span)))))
(defun polymode-mark-chunk ()
(let ((span (pm/get-innermost-span)))
(goto-char (nth 1 span))
(set-mark (line-beginning-position))
(goto-char (nth 2 span))
(goto-char (line-end-position))))
(evil-define-text-object evil-inner-polymode-chunk (count &optional beg end type)
"Select inner polymode chunk."
:type line
(polymode-mark-inner-chunk)
(evil-range (region-beginning)
(region-end)
'line))
(evil-define-text-object evil-a-polymode-chunk (count &optional beg end type)
"Select a polymode chunk."
:type line
(polymode-mark-chunk)
(evil-range (region-beginning)
(region-end)
'line))
from polymode.
I have finally added integration for evil mode. Sorry for taking so long.
My understanding of modal editing hardly goes beyond hjkl
but it seems to work as expected. I would very much like to hear form an evil user that it actually works.
Inspired by the multi-mode-evil.el I have introduced a custom variable:
(defcustom polymode-evil-states '(normal insert emacs)
"States of evil-mode to be preserved when switching indirect buffers."
:type '(symbol)
:group 'polymode-compat)
Is this really needed? Don't you want to preserve all the states when moving between spans and chunks?
from polymode.
On Sun, Feb 28, 2016 at 1:39 AM, Vitalie Spinu [email protected]
wrote:
Don't you want to preserve all the states when moving between spans and
chunks?
That policy makes sense to me.
(I'll try to test the changed mode soon.)
from polymode.
@vspinu, this is AWESOME.
from polymode.
I'm having the problem referenced above by @vsbuffalo where using undo-tree minor mode within polymode will insert gibberish into buffer on occasion and the undo history seems corrupted. I'm not using evil-mode so I don't think it's related to that but wondering if it was resolved for you.
from polymode.
Same here, using evil-mode. Undo history corrupted.
from polymode.
Undo movement between indirect buffers is handled by emacs internals. If undo is corrupted that could mean something is not quite right other there. IN any case I would apreciate a reproducible example here. Would you mind opening a new issue for this?
from polymode.
This should be a reproducible example: #214
from polymode.
Related Issues (20)
- Help with a (hopefully) simple polymode?
- Reproducible error: stuck in latex-mode
- Starting polymode with lsp, makes the cursor to jump to the end of buffer HOT 10
- can't find polymode via package-install? HOT 1
- electric-indent-mode
- How to run a function is indirect buffers with the same major mode only?
- Typescript-xml polymode
- Setting mode file local variable to polymode applies itself recursively infinitely until cancelled
- Background Adjustment when Background Unspecified
- polymode creates additional [web] buffer
- Interaction with nix-mode: font-lock broken HOT 4
- Chunks not following automatic Emacs switch to light/dark theme HOT 5
- Polymode, Poly-COMEEGA and COMEEGA (Collaborative Org Mode Enhanced Emacs Generalized Authorship)
- inner mode indentation not works on the first line after head mark
- org-mode links become invisible HOT 3
- Polymode does not work in org-edit-special
- eglot sees the whole outer buffer content HOT 3
- hs-hide-all gives unbalanced parentheses error when it shouldn't in some Rnw buffers
- Inconsistent font size in heads
- Beginning of the Polymode buffer is ignored by flymake HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polymode.