Coder Social home page Coder Social logo

Comments (18)

vspinu avatar vspinu commented on July 1, 2024 1

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.

vsbuffalo avatar vsbuffalo commented on July 1, 2024

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.

lionel- avatar lionel- commented on July 1, 2024

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.

vsbuffalo avatar vsbuffalo commented on July 1, 2024

@lionelgit is there a way to tweak polymode to tell it to share evil state among buffers? This issue is quite irritating :-)

from polymode.

lionel- avatar lionel- commented on July 1, 2024

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.

vsbuffalo avatar vsbuffalo commented on July 1, 2024

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.

lionel- avatar lionel- commented on July 1, 2024

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.

vsbuffalo avatar vsbuffalo commented on July 1, 2024

Is there any update on this?

from polymode.

vspinu avatar vspinu commented on July 1, 2024

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.

holtzermann17 avatar holtzermann17 commented on July 1, 2024

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.

lionel- avatar lionel- commented on July 1, 2024

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.

vspinu avatar vspinu commented on July 1, 2024

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.

holtzermann17 avatar holtzermann17 commented on July 1, 2024

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.

roryk avatar roryk commented on July 1, 2024

@vspinu, this is AWESOME.

from polymode.

stefanavey avatar stefanavey commented on July 1, 2024

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.

philipphoman avatar philipphoman commented on July 1, 2024

Same here, using evil-mode. Undo history corrupted.

from polymode.

vspinu avatar vspinu commented on July 1, 2024

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.

jody-frankowski avatar jody-frankowski commented on July 1, 2024

This should be a reproducible example: #214

from polymode.

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.