You are here: PSPad forum > English discussion forum > Help with PSPad's wordwrap

Help with PSPad's wordwrap

#1 Help with PSPad's wordwrap

Posted by: EdenZhiweis | Date: 2021-03-31 18:58 | IP: IP Logged

,

I use PSPad as my editor and it has a quirk which is, if the file being edited is larger than certain size, then PSPad can't retain the wordwrap setting. It will be toggled off upon exiting the editor.

Therefore I was thinking of an AHK script with a timer that can check the toggle state on PSPad and turn wordwrap on if necessary.

I have a pseudo-code of sorts but am having trouble translating it into proper AHK code. I would appreciate if someone could assist in this matter.

Options: Reply | Quote | Up ^


#2 Re: Help with PSPad's wordwrap

Posted by: pspad | Date: 2021-03-31 19:10 | IP: IP Logged

Hello

Better than script will be set higher limit for WordWrap.
Currenty the limit is set to 200 000 bytes
If you want to incrase limit, go to program settings / Direct edit button
Set the size to e.g. 500 000

MaxWrapSize=500000

Options: Reply | Quote | Up ^


#3 Re: Help with PSPad's wordwrap

Posted by: EdenZhiweis | Date: 2021-04-01 10:07 | IP: IP Logged

EdenZhiweis:
,

I use PSPad as my editor and it has a quirk which is, if the file being edited is larger than certain size, then PSPad can't retain the wordwrap setting. It will be toggled off upon exiting the editor. 100001.onl

Therefore I was thinking of an AHK script with a timer that can check the toggle state on PSPad and turn wordwrap on if necessary.

I have a pseudo-code of sorts but am having trouble translating it into proper AHK code. I would appreciate if someone could assist in this matter.

issue gt solved

Options: Reply | Quote | Up ^


#4 Re: Help with PSPad's wordwrap

Posted by: jaspritvid | Date: 2022-10-12 07:35 | IP: IP Logged

anyone know if it's possible to set the word wrap line (on the ruler) to a starting position other than the default one? I really don't like having it start in the middle of the page, and having to set it each time I run PsPad.

Options: Reply | Quote | Up ^


#5 Re: Help with PSPad's wordwrap

Posted by: pspad | Date: 2022-10-12 09:00 | IP: IP Logged

Hello

You can set ruller position in the settings to position you want, in the
Settings / Editor 1 as Position of Right edge

Second possibility is in Settings / Program 1 uncheck Wrap with Right edge and PSpad will wrap lines according to window width

Options: Reply | Quote | Up ^


#6 Re: Help with PSPad's wordwrap

Posted by: rioden | Date: 2024-02-15 10:09 | IP: IP Logged

Sure, I can help you write an AutoHotkey (AHK) script to handle the wordwrap toggling in PSPad. Here's how you can do it:

```autohotkey
#Persistent
SetTimer, CheckPSPadWordWrap, 1000
return

CheckPSPadWordWrap:
SetTitleMatchMode, 2
IfWinExist, PSPad
{
WinActivate, PSPad
WinWaitActive, PSPad
Send ^n ; Send Ctrl+N to ensure the WordWrap menu is active
Sleep 100 ; Wait for the menu to open
Send !v ; Send Alt+V to open the View menu
Sleep 100 ; Wait for the menu to open
Send w ; Send 'w' to toggle WordWrap
}
return
```

Here's what this script does:

- `#Persistent`: Keeps the script running after the initial auto-execute section completes.
- `SetTimer, CheckPSPadWordWrap, 1000`: Sets a timer to execute the `CheckPSPadWordWrap` function every 1000 milliseconds (1 second).
- The `CheckPSPadWordWrap` function does the following:
- Sets the title match mode to 2 (allowing partial title matches).
- Checks if a window with the title containing "PSPad" exists.
- If PSPad is open:
- Activates the PSPad window.
- Waits for the window to become active.
- Sends Ctrl+N to ensure the WordWrap menu is active.
- Sends Alt+V to open the View menu.
- Sends 'w' to toggle WordWrap.
- The script continuously checks if PSPad is open and toggles WordWrap if necessary.

Save this script with a `.ahk` extension and run it. It should continuously check and toggle the wordwrap setting in PSPad for you. Make sure to adjust the timings or add delays if necessary, based on your system's responsiveness and the speed at which PSPad responds to commands.

Edited 1 time(s). Last edit at 2024-02-15 12:52 by pspad.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR