summaryrefslogtreecommitdiffstats
path: root/SlickEdit
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--SlickEdit/kdev.e39
1 files changed, 38 insertions, 1 deletions
diff --git a/SlickEdit/kdev.e b/SlickEdit/kdev.e
index 59e497e..8049cbc 100644
--- a/SlickEdit/kdev.e
+++ b/SlickEdit/kdev.e
@@ -1,4 +1,4 @@
-/* $Id: kdev.e 3589 2023-02-20 10:07:39Z bird $ -*- tab-width: 4 c-indent-level: 4 -*- */
+/* $Id: kdev.e 3604 2024-02-04 23:19:33Z bird $ -*- tab-width: 4 c-indent-level: 4 -*- */
/** @file
* Visual SlickEdit Documentation Macros.
*/
@@ -73,6 +73,7 @@ def 'C-S-P' = k_mark_modified_line
def 'C-S-S' = k_box_structs
def 'C-S-T' = k_rebuild_tagfile
def 'C-S-L' = k_style_load
+def 'C-S-\' = k_newline_escape_selection
//optional stuff
//def 'C-S-Q' = klib_klog_file_ask
@@ -1686,6 +1687,42 @@ void k_noref()
_insert_text(sNoRefs);
}
+/* Adds newline escape slashes to the current selection. */
+void k_newline_escape_selection()
+{
+ filter_init();
+ typeless rc = filter_get_string(sLine);
+ if (rc == 0)
+ {
+ _str sPrev = '';
+ do
+ {
+ /* */
+ if (sLine != '')
+ sLine = sLine ' \';
+ else
+ {
+ int offNonWhitespace = pos("[^ \t]", sPrev, 1, 'L');
+ if (offNonWhitespace > 0)
+ sLine = _pad(sLine, offNonWhitespace - 1, ' ');
+ sLine = sLine '\';
+ }
+
+ filter_put_string(sLine);
+
+ /* next line */
+ sPrev = sLine;
+ rc = filter_get_string(sLine);
+ } while (rc == 0);
+
+ }
+ else if (isinteger(rc))
+ message(get_message(rc));
+ else
+ message(rc);
+}
+
+
/*******************************************************************************
* kLIB Logging *
*******************************************************************************/