cssideeditingkomodolive-preview

Live Preview or LiveReload during editing of CSS and HTML in Komodo IDE?


I have heard a lot about Komodo IDE. Does Komodo IDE have an extension or native support for Live preview? Could Komodo IDE be extended to have some sort of live preview when editing CSS and HTML?

I really want to try an IDE or editor with something like live preview with good code hinting when editing CSS. I know Expresso has LivePreview, but it is only for Mac and I am using Windows. Sublime Text with LiveReload is great, but the code hinting is a little poor. Are there other editors/IDE that offer this feature?


Solution

  • There is a Komodo macro which can be extended to auto reload all browser preview tabs using setInterval:

    function refreshViews()
      {
      var views = ko.views.manager.getAllViews();
      var view;
    
      // Loop through all open tabs to find the browser preview tabs
      for (var i=0; i < views.length; i++) 
        {
        view = views[i];
        // Reload each preview tab
        if (view.getAttribute("type") == "browser") 
          {
          view.reload();
          }
        }
      }
    
     setInterval(refreshViews, 2000);  // Reload every two seconds