Giter VIP home page Giter VIP logo

Comments (6)

keforbes avatar keforbes commented on May 29, 2024

Are you able to get more info from the AnyEdit folks to see what exactly the "global save event" is? There's probably a way for me to manually fire that event if I know exactly what it is.

As for Vrapper, when you do :w we invoke AbstractTextEditor.doSave(). When you do :wall we invoke AbstractTextEditor.getSite().getWorkbenchWindow().getWorkbench().saveAllEditors(). I'm not really sure what to do if those methods don't fire global save events. I'm not aware of other save methods that we should be invoking instead.

I don't mind making this change to support AnyEdit if you can find what exactly needs to be changed.

from vrapper.

iloveeclipse avatar iloveeclipse commented on May 29, 2024

Hi,
I'm the AnyEdit guy :-)

I think that you have to execute something like this:

    IHandlerService handlerService = (IHandlerService) PlatformUI
            .getWorkbench().getService(IHandlerService.class);
    try {
        handlerService.executeCommand(IWorkbenchCommandConstants.FILE_SAVE, null);
    } catch (CommandException e) {
        // TODO Auto-generated catch block
    } 

instead of directly calling doSave(). All the required hooks will be then executed. AnyEdit works on IExecutionListener.preExecute() hook, which is triggered by the "save" command execution (e.g. if one just hits "Ctrl+S" or clicks on the "save" button).
I did not tried it but I guess this should work.
Regards,
Andrey

from vrapper.

keforbes avatar keforbes commented on May 29, 2024

Copy and pasting code is definitely something I'm capable of! Thanks for doing the hard work for me. :) The :w command still appears to work so it's all the same on my end. I'll just assume I need to make a similar change for the "save all" operation and use IWorkbenchCommandConstants.FILE_SAVE_ALL. Thanks again!

from vrapper.

keforbes avatar keforbes commented on May 29, 2024

Ok, I've updated the unstable update site with 0.21.20120527. This version contains the refactored save operations. Please install it alongside AnyEdit and let me know if Andrey's fix didn't actually work. Thanks!

from vrapper.

 avatar commented on May 29, 2024

Thanks very much for the fast turnaround. I'll try it out when I get back
in an hour or two and let you know how it looks.

from vrapper.

 avatar commented on May 29, 2024

That looks great, tested both :w and :wall and both seem to work as they expected. Thanks very much kerforbes and Andrey for the fast resolution to this issue.

from vrapper.

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.