Author Topic: Is there a way to clear all of the "modified lines" marks for an entire project?  (Read 1203 times)

timur

  • Senior Community Member
  • Posts: 188
  • Hero Points: 3
I have configured Slickedit to remember modified lines.  I like to keep them marked as I work on a change over several days.  Once my change is merged, I want to clear all of those marks because they're no longer relevant.

Is there a way to do that in one fell swoop?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6203
  • Hero Points: 481
Sounds like all you need is a command to reset all the modify flags for a particular file. Pretty easy to do.

If so, we can add reset-modify-line-flags command to 24.0.1. 24.0.0 is already baked.
« Last Edit: September 27, 2019, 12:06:28 am by Clark »

Graeme

  • Senior Community Member
  • Posts: 2702
  • Hero Points: 336
24.0.0 is already baked.

Blow.  I didn't get time to do much testing.  I suspect xretrace doesn't work properly in 24.0.0.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6203
  • Hero Points: 481
Let me know if you need any help with it.

timur

  • Senior Community Member
  • Posts: 188
  • Hero Points: 3
I'm on v23, so adding it to v24 won't help me.

I assume I would need to write a macro to apply the change to all files in a project?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6203
  • Hero Points: 481
I missed it. There's already a command to do this.

reset_modified_lines

timur

  • Senior Community Member
  • Posts: 188
  • Hero Points: 3
That function only works on the current open file.  I guess that'll have to do for now, but I would love to see a built-in function that works on the entire project.

Is there a configuration file I can manually edit to clear all of the modified lines in an entire project, or even just everywhere?  I don't see anything in the VPJ file.

In the meantime, how would I write a macro that loops over all files in a project?  And is there a way to "silently" open a file so that I can run reset_modified_lines() on it? 
« Last Edit: September 30, 2019, 08:01:23 pm by timur »

Graeme

  • Senior Community Member
  • Posts: 2702
  • Hero Points: 336
Here's a command from my xxutils.e macro file (in the user macros section) that you can adapt - it iterates over project files.  You can also use the slick file manager (see File Manager in the File menu) to run a command over a list of files.


Code: [Select]
#include "slick.sh"
#include "tagsdb.sh"

_command void xbeautify_project(boolean ask = true, boolean no_preview = false, boolean autosave = true) name_info(',')
{
   _str files_to_beautify [];

   //_GetWorkspaceFiles(_workspace_filename, files_to_beautify);
   _getProjectFiles( _workspace_filename, _project_get_filename(), files_to_beautify, 1);

   if (ask && !no_preview) {
      activate_preview();
   }

   int k;
   for (k = 0; k < files_to_beautify._length(); ++k) {
      if (ask) {

         if (!no_preview) {
            struct VS_TAG_BROWSE_INFO cm;
            tag_browse_info_init(cm);
            cm.member_name = files_to_beautify[k];
            cm.file_name = files_to_beautify[k];
            cm.line_no = 1;
            cb_refresh_output_tab(cm, true, false, false);
            _UpdateTagWindowDelayed(cm, 0);
         }

         _str res = _message_box("Beautify " :+ files_to_beautify[k], "Beautify project", MB_YESNOCANCEL|IDYESTOALL);
         if (res == IDCANCEL) return;
         if (res == IDNO) continue;
         if (res == IDYESTOALL) ask = false;
      }

      if (edit("+B " :+ files_to_beautify[k]) == 0) {
         beautify();
         if (autosave) save();
      }
      else
      {
         edit(files_to_beautify[k]);
         beautify();
         if (autosave) save();
         quit();
      }
   }
}