SurroundSelection | Notepad++ plugin to automatically surround the selection | Plugin library
kandi X-RAY | SurroundSelection Summary
kandi X-RAY | SurroundSelection Summary
Notepad++ plugin to automatically surround the selection in quotes/brackets/parenthesis/etc. This can also be used on multiple or rectangular selections.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SurroundSelection
SurroundSelection Key Features
SurroundSelection Examples and Code Snippets
Community Discussions
Trending Discussions on SurroundSelection
QUESTION
I have a div which is being used as a user-friendly text editor on my school-project website. However if I select all of the text inside the editor and attemp to surround it with
I can not get the cursor out of it, it keeps adding whatever i type into the same tag, which is tags
.
After some time I gave up on it, but then I found this answer and tried to modify the jsfiddle that is mentioned there in the hopes of getting it to work. But no luck.
If I, lets say, select the last word in any line and surround it with
tags, I am able to get the cursor out of it where there is non-surrounded text but on the end there's no plaintext to jump onto so the cursor is stuck in
How can I make sure that the cursor doesn't get stuck in added tags?
maybe a way to move the cursor out of it?
jsFiddle
...
ANSWER
Answered 2019-Jan-02 at 23:02A slightly quirky workaround here. No longer using surround but instead copying contents into the new node. We then add a space at the end. It it now possible to click after the code block, even if all text was selected.
EDIT: Added sel.collapseToEnd(); as per comment (thanks). It improves the experience by putting the user straight into normal typing context. However, the space is still required, it does not work without it.
EDIT: Now adds space to the start and end.
EDIT: Remove spacers for send to server.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SurroundSelection
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page