Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npp still does not allow you to paste when clipped content format is changed by clipboard manager. #15131

Open
1 task done
Norlandz opened this issue May 12, 2024 · 1 comment

Comments

@Norlandz
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

eg: say
you want to paste a file path to a txt file in npp
you copy the file,
but npp wont allow you to paste,
because this is a file, not text.

so you did some scripting to automatically convert that file into a file path text inside your clipboard (by a clip manager / ahk).

however, npp still does not allow you to paste -- BAD
-- npp still treats the item in your clipboard as a file, not a file path text.

you have to type a letter to "refresh" npp so that npp recognize the change in the clipboard.

Steps To Reproduce

  1. copy a file
  2. go to a txt file in npp
  3. (for now npp wont allow you to paste)
  4. some script run in the background to convert the file into a file path text automatically inside the clipboard
  5. press ctrl+v
  6. npp still wont allow you to paste -- BAD
  7. type a letter (or switch to another window then switch back)
  8. now npp will allow you to paste

Current Behavior

Npp doesnt recognize the change in the clipboard,
and you cannot paste.

Expected Behavior

Npp does recognize the change in the clipboard,
and you can paste.

Debug Information

Notepad++ v8.6.5   (64-bit)
Build time : Mar 29 2024 - 17:04:43
Path : E:\Notepad++\notepad++.exe
Command Line : "C:\Users\Azeri\Desktop\textsav.txt"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
OS Name : Windows 10 Home (64-bit
OS Version : 22H2
OS Build : 19045.4291
Current ANSI codepage : 936
Plugins : 
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)

Anything else?

eg:

copy a file, but you cannot paste
untitled-7Tbe-20240512_1848_33461

a script changed the file into text format, but you still cannot paste -- BAD
untitled-I9kB-20240512_1851_28116

type a letter, now you can paste
notepad++-20240512_1852_12043

@Norlandz
Copy link
Author

Norlandz commented May 12, 2024

If this cannot be fixed any time soon.

Is there a workaround a least to:
"refresh" npp to recognize the change of clipboard
-- other than type a letter / switch window
-- its better if it can be done programmatically by ahk with minimal impact to the using experience
?

Thanks


Here is the current workaround.
Press Insert can refresh npp and has minimal impact.

  • (even if you paste accidentally with overwrite mode, it will still do "insert" instead of "overwrite", so its safe.)
  if (WinActive("ahk_exe notepad++.exe")) {
    ; SendInput("{Left}{Right}")
    SendInput("{Insert 2}")
    ; SendInput("{WheelDown}{WheelUp}")
  }
  Sleep(10)
  SendInput("^v")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant