My keyboard mapping maps Ctrl+S to FileSave (natch).
If nothing is selected, and I hit Ctrl+S, the file saves. If I select a word and hit Ctrl+S, the file saves. But if I select across lines (more than one line is in the selection) and hit Ctrl+S, the Save As dialog appears.
Huh?
FileSave does a save-as if there are lines selected?
-
- Posts: 6
- Joined: Wed May 03, 2006 1:48 am
If nothing is selected, and I hit Ctrl+S, the file saves. If I select a word and hit Ctrl+S, the file saves. But if I select across lines (more than one line is in the selection) and hit Ctrl+S, the Save As dialog appears.
The idea behind feature is to allow for a quick way to save a section of text to an alternative file. It has the same effect as if you had marked and area, copy text to clipboard, selected file new, paste the text into the document and then hit file save.
To remove this behaviour just re-bind the the key to the following Lua macro:
Code: Select all
function key_macro()
-- look for a marked area
local marked = is_marked()
if marked == 1 then
-- save the current markings
cursor_save()
-- remove the markings
MarkHide()
-- call the save function
FileSave()
-- restore the markings
cursor_restore()
else
-- let the file save handle the rest
FileSave()
end
end
key_macro() -- run the macro
-
- Posts: 6
- Joined: Wed May 03, 2006 1:48 am
Update the doc?
Thanks: perhaps this behavior could be described in the documentation for FileSave?