How get access to Undo buffer from plugins?

Hello
If we now create our editor plugins, then we need to Redo/Undo work in
editors.
How to use Undo/Redo from my plugin?
Thanks

--
Alexey Efimov, Software Engineer
Sputnik Labs,
http://www.spklabs.com


7 comments
Comment actions Permalink

Does your editor modify Document for its file? If it does undo should work
automatically.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Alexey Efimov" <aefimov@spklabs.com> wrote in message
news:bkc39a$9v1$1@is.intellij.net...

Hello
If we now create our editor plugins, then we need to Redo/Undo work in
editors.
How to use Undo/Redo from my plugin?
Thanks

>

--
Alexey Efimov, Software Engineer
Sputnik Labs,
http://www.spklabs.com

>
>


0
Comment actions Permalink

Thank you!
But then i create FileEditor where no way to get Editor?
Editor have method getDocument

--
Alexey Efimov, Software Engineer
Sputnik Labs,
http://www.spklabs.com
"Valentin Kipiatkov (JetBrains)" <valentin@intellij.com> wrote in message
news:blk35r$dus$1@is.intellij.net...

Does your editor modify Document for its file? If it does undo should work
automatically.

>

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

>

"Alexey Efimov" <aefimov@spklabs.com> wrote in message
news:bkc39a$9v1$1@is.intellij.net...

Hello
If we now create our editor plugins, then we need to Redo/Undo work in
editors.
How to use Undo/Redo from my plugin?
Thanks

>

--
Alexey Efimov, Software Engineer
Sputnik Labs,
http://www.spklabs.com

>
>

>
>


0
Comment actions Permalink

Valentin Kipiatkov (JetBrains) wrote:

>Does your editor modify Document for its file? If it does undo should work
>automatically.
>

>

With folding, it's not automatic :
Undo also undoes folding operations. Good.
In the camouflage plugin, I do a lot of folding, but it's not undone
with Undo.

Do I need to 'register' the operation in some way?

Alain

0
Comment actions Permalink

Undo also undoes folding operations. Good.


I do not think so. Are you sure it does?

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"


"Alain Ravet" <alain.ravet.list@wanadoo.be> wrote in message
news:blk44h$l4d$1@is.intellij.net...

Valentin Kipiatkov (JetBrains) wrote:

>

>Does your editor modify Document for its file? If it does undo should

work

>automatically.
>
>
>

>

With folding, it's not automatic :
Undo also undoes folding operations. Good.
In the camouflage plugin, I do a lot of folding, but it's not undone
with Undo.

>

Do I need to 'register' the operation in some way?

>

Alain

>


0
Comment actions Permalink

Valentin Kipiatkov (JetBrains) wrote:

>>Undo also undoes folding operations. Good.
>>
>>
>
>I do not think so. Are you sure it does?
>

>

It's a recent addition, but it does. I've just checked.

Alain

0
Comment actions Permalink

It's a recent addition, but it does. I've just checked.


Hmm... I've also checked and it does not. Could you please provide exact
steps to reproduce?

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"


"Alain Ravet" <alain.ravet.list@wanadoo.be> wrote in message
news:blk4k3$l4d$4@is.intellij.net...

Valentin Kipiatkov (JetBrains) wrote:

>

>>Undo also undoes folding operations. Good.
>>
>>
>
>I do not think so. Are you sure it does?
>
>
>

>

It's a recent addition, but it does. I've just checked.

>

Alain

>


0
Comment actions Permalink

Valentin Kipiatkov (JetBrains) wrote:

>>It's a recent addition, but it does. I've just checked.
>>
>Hmm... I've also checked and it does not. Could you please provide exact
>steps to reproduce?
>


A mirage . That's the only explanation I can find.
I've been wishing for this feature for so long, that I saw a mirage.

I was misled by the following sequence of actions :


Before
-


    }
]]>




Action :
-




After
-


]]>




Action :
-



=> unfolds the previously folded method



I'll post a request for undo to undo folding. Too bad the feature list
is frozen. That will be another 3-6 months, if..


0

Please sign in to leave a comment.