Page 1 of 1

"Save" and "Save All" actions

Posted: 28 Nov 2025 05:28
by evolutionary
The "Save" and "Save All" toolbar buttons don't sync with the actual state of the files being edited.
Sometimes a file is modified, but the buttons are inactive - have to forced press "Ctrl + S". Sometimes, after clicking "Save" or "Save All," the yellow status indicator doesn't immediately change to green, making it unclear whether the file has been saved or not. You have to click the button twice or even thrice.
This has been a problem for many last versions; I've been using the editor for several years now.
I was hoping this would be fixed with the next update, but updates keep coming, and the bug remains.
Please note for this.

Re: "Save" and "Save All" actions

Posted: 28 Nov 2025 14:05
by Rickard Johansson
That's because no one has ever reported this issue and I haven't seen it myself.

Issues that only one, or very few, users experience are the toughest to fix. I usually require some help from the user to fix it.

1. You settings file may help <AppData>\Roaming\RJ TextEd\TextEd.ini.
2. An example file.
3. Clear steps to reproduce.
4. Maybe even a short video displaying the issue.
5. Some information about your system... Windows version, program version and other things that may be relevant.

Re: "Save" and "Save All" actions

Posted: 12 Dec 2025 09:48
by evolutionary
Example:
1: tab indicator is green -> content not changed, but "Save" button enabled.
2: tab indicator is yellow -> content changed (need save), but '"Save" button disabled.

Re: "Save" and "Save All" actions

Posted: 12 Dec 2025 16:26
by evolutionary
For now, I've created a temporary solution. I created a simple tool, sending Ctrl+S, placed it on the toolbar as an external tool, and it works fine.

Code: Select all

#include <Windows.h>


void* mem_set(void* buf, char z, size_t bytes)
  {
  if ((!bytes) || (!buf)) return buf;

  #define MAKEULONGLONG(hi, lo) (ULONGLONG)(((DWORD_PTR)(hi) & 0xffffffff) << 32) | (ULONGLONG)((DWORD_PTR)(hi) & 0xffffffff)

  unsigned __int64 wz = MAKEULONGLONG(MAKELONG(MAKEWORD(z, z), MAKEWORD(z, z)), MAKELONG(MAKEWORD(z, z), MAKEWORD(z, z)));
  size_t i, m;
  unsigned __int64* wdst = (unsigned __int64*)buf;
  for (i = 0, m = bytes / sizeof(unsigned __int64); i < m; i++) * (wdst++) = wz;

  unsigned char* cdst = (unsigned char*)wdst;
  for (i = 0, m = bytes % sizeof(unsigned __int64); i < m; i++) * (cdst++) = z;

  return buf;
  }


void SendCtrlS(void)
  {
  HWND hForeground = GetForegroundWindow();
  if (!hForeground) return;

  INPUT inputs[4];

  mem_set(inputs, 0, sizeof(inputs));

  inputs[0].type = INPUT_KEYBOARD;
  inputs[0].ki.wVk = VK_CONTROL;
  inputs[0].ki.dwFlags = 0;

  inputs[1].type = INPUT_KEYBOARD;
  inputs[1].ki.wVk = 'S';
  inputs[1].ki.dwFlags = 0;

  inputs[2].type = INPUT_KEYBOARD;
  inputs[2].ki.wVk = 'S';
  inputs[2].ki.dwFlags = KEYEVENTF_KEYUP;

  inputs[3].type = INPUT_KEYBOARD;
  inputs[3].ki.wVk = VK_CONTROL;
  inputs[3].ki.dwFlags = KEYEVENTF_KEYUP;

  SendInput(4, inputs, sizeof(INPUT));
  }

INT main()
  {
  SendCtrlS();
  Sleep(100);
  SendCtrlS();
  }