File Specific word wrap (vs. global enable)
-
@Claudia-Frank 's FIRST Pythonscript in this thread really shines if the Wrap status is added to the status bar using the technique shown in the following thread: https://notepad-plus-plus.org/community/topic/13134/set-read-only-edit-function-feature-request. In that thread, the read-only status of the current file is shown (based upon a script in yet-another thread…sorry), but that can be modified to show the wrap status as follows:
Change
line_col_sel_info_for_sb = 'Ln : {user_line} Col : {user_col} Sel : {sel} {ro}r'.format( user_line=curr_line+1, user_col=curr_col+1, sel=sel_part, ro='+' if editor.getReadOnly() else '-' )
to
line_col_sel_info_for_sb = 'Ln : {user_line} Col : {user_col} Sel : {sel} {w}'.format( user_line=curr_line+1, user_col=curr_col+1, sel=sel_part, w='W' if editor.getWrapMode() == 1 else '' # show 'W' in status bar if wrap mode is on for this file )
-
Scott,
don’t dig to deep to find my all of my youthful follies. ;-)
Cheers
Claudia -
Yea, I can tell that is earlier code from you, but it works!
-
I know this topic old but I tried the referenced solution and could not get it to work.
I went to PLUGINS > PYTHON SCRIPT > NEW SCRIPT and saved the example code as file_word_wrap.
When I go to PLUGINS > PYTHON SCRIPT > SCRIPTS and click on file_word_wrap I get error: AN EXCEPTION OCCURRED DUE TO PLUGIN: PYTHONSCRIPT.DLL EXCEPTION REASON: ACCESS VIOLATIONI also added …
<Item PluginEntryName=“Python Script” PluginCommandItemName=“file_word_wrap” />
… at the bottom of contextMenu.xml as instructed but did not see it as a right-click option. -
Hi @Clyfton-In , All:
I also know that this topic is old, but tried today the python script and it worked fine for me.
The following picture includes the relevant code and highlights the status bar zone that shows the requested info:
BR
-
The Pythonscript is great and all, but this surely feels like something that should be offered as a feature in stock Notepad++. My 2c.
-
I think so. I also think that the regex indicators —not shown in my picture— are a nice and helpfull add-on.
-
@astrosofista said in File Specific word wrap (vs. global enable):
regex indicators
What “regex indicators” are you referring to? Did I miss something?
-
@Alan-Kilborn said in File Specific word wrap (vs. global enable):
@astrosofista said in File Specific word wrap (vs. global enable):
regex indicators
What “regex indicators” are you referring to? Did I miss something?
Sorry, my wording wasn’t clear enough. I was referring to the regex metacharacters that Scott Sumner used to enrich the info about the selected characters and lines. They are listed here:
-
-
-
I revisit the original topic of this thread HERE.
-