diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 07:33:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 07:33:58 +0000 |
commit | 77d6698bdfbc3fb878cb4490061f50e24a2cabec (patch) | |
tree | 33b9119b2179ed4aa93cea8c29fc1615ee8db9a7 /SlickEdit | |
parent | Adding upstream version 1:0.1.9998svn3589+dfsg. (diff) | |
download | kbuild-upstream.tar.xz kbuild-upstream.zip |
Adding upstream version 1:0.1.9998svn3604+dfsg.upstream/1%0.1.9998svn3604+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'SlickEdit')
-rw-r--r-- | SlickEdit/kdev.e | 39 |
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 * *******************************************************************************/ |