Re: [scite] for your consideration, a patch to OpenSelected()
April White: The code for finding if the path is a directory should use FilePath::IsDirectory which is portable. I forgot, thank you. I'll upload a new version with this change and include the documentation change as well. I'll probably start a new message thread at that point. I forgot too and was about to say that you should break the code into a directory check in FilePath and the code that acts on that before I looked in FilePath and it was already there. Neil ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re: [scite] for your consideration, a patch to OpenSelected()
Neil Hodgson wrote: Are you open to conditional compilation? ... ... You could write a patching script. I can learn how to make and use diff patch I guess. The code for finding if the path is a directory should use FilePath::IsDirectory which is portable. I forgot, thank you. I'll upload a new version with this change and include the documentation change as well. I'll probably start a new message thread at that point. April -- The phrase working mother is redundant. -- Jane Sellman ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re: [scite] for your consideration, a patch to OpenSelected()
April White: I am not sure where we stand on this change. I have altered SciTEDoc.html but have not uploaded it yet. On the basis of not being useful often enough I don't think this should go in. Of course other people like commands I never use but if this is seen as needed by others, they should say they want it, preferably explaining the circumstances in which it would help them. Neil ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re: [scite] for your consideration, a patch to OpenSelected()
April White: I am unsure whether to change SciTE.rc: MENUITEM Open Selected Filename\tCtrl+Shift+O,IDM_OPENSELECTED to MENUITEM Open Selected Filename or Folder\tCtrl+Shift+O, IDM_OPENSELECTED Its not really opening a folder: IIRC EMACS has sort of directory-editing mode and I wouldn't want this command to be confused with something like that. BTW I noticed that scite/scripts/commandsdoc.py has this line: !--Generated by scite/scripts/scommandsdoc.py -- notice the 's' preceding commandsdoc.py Fixed now. Neil ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re: [scite] for your consideration, a patch to OpenSelected()
Neil Hodgson wrote: April White: I've found it useful to be able to easily open the folder that the filename is in, without having to ... Is this seen by others as a commonly needed operation? Everyone works differently and this doesn't seem to me to be something that I'd use. Its not easily discoverable either although possibly some documentation would help. I forgot about the documentation. I have altered the SciTEDoc.html file section Open Selected Filename with: On Windows only, if the selected file name is actually a directory, the Open dialog will appear. I am unsure whether to change SciTE.rc: MENUITEM Open Selected Filename\tCtrl+Shift+O,IDM_OPENSELECTED to MENUITEM Open Selected Filename or Folder\tCtrl+Shift+O, IDM_OPENSELECTED (This change would be carried forward into CommandValues.html by scite/scripts/commandsdoc.py) BTW I noticed that scite/scripts/commandsdoc.py has this line: !--Generated by scite/scripts/scommandsdoc.py -- notice the 's' preceding commandsdoc.py April -- Quitters never win, and winners never quit, and if you never win and never quit, you're just obsessive/compulsive -- Roxanne Longstreet (Rachel Caine) ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re[2]: [scite] for your consideration, a patch to OpenSelected()
Saturday, August 18, 2007, 7:16:04 AM, Neil wrote: NH April White: a suggested patch to the OpenSelected() method so that if the selected text is a directory, the 'open dialog' appears. NHWhy would someone want this? In SciTe-Ru Pack IDM_OPENSELECTED command is replaced on lua a script. As against the IDM_OPENSELECTED command, that works only with obviously set path and relative path, the script processes variables SciTE, variable environments, designs LUA. So, for example, it is possible to open a file if the path to it is set down so: $(SciteDefaultHome)\tools\RunReg.js Or so: %APPDATA%\Opera\Opera\profile\opera6.ini Or so: props[SciteDefaultHome]..\\tools\\Zoom.lua It is possible to modify this script to gain, if necessary, dialogue of opening of a file in the set directory. Source: - -- Open_Selected_Filename.lua -- mozers™, vladvro -- version 1.2 --- -- Connection: -- In file SciTEStartup.lua add a line: -- dofile (props[SciteDefaultHome]..\\tools\\Open_Selected_Filename.lua) --- local function Open_Selected_Filename() local filename if editor.Focus then filename = editor:GetSelText() else filename = output:GetSelText() end local foropen = nil -- Example: $(SciteDefaultHome)\tools\RunReg.js local pattern_sci = '^$[(](.-)[)]' local _, _, scite_var = string.find(filename,pattern_sci) if scite_var ~= nil then foropen = string.gsub(filename, pattern_sci, props[scite_var]) else -- Example: %APPDATA%\Opera\Opera\profile\opera6.ini local pattern_env = '^[%%](.-)[%%]' local _, _, os_env = string.find(filename, pattern_env) if os_env ~= nil then foropen = string.gsub(filename, pattern_env, os.getenv(os_env)) else -- Example: props[SciteDefaultHome]..\\tools\\Zoom.lua local pattern_props = '^props%[%p(.-)%p%]%.%.%p(.*)%p' local _, _, scite_prop1, scite_prop2 = string.find(filename,pattern_props) if scite_prop1 ~= nil then foropen = props[scite_prop1]..scite_prop2 end end end if foropen ~= nil then foropen = string.gsub(foropen, '', '\\') scite.Open (foropen) return true end end -- Add user event handler OnMenuCommand local old_OnMenuCommand = OnMenuCommand function OnMenuCommand (msg, source) local result if old_OnMenuCommand then result = old_OnMenuCommand(msg, source) end if msg == 103 then --IDM_OPENSELECTED if Open_Selected_Filename() then return true end end return result end -- mozers http://scite.ruteam.ru ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re: [scite] for your consideration, a patch to OpenSelected()
Neil Hodgson wrote: April White: a suggested patch to the OpenSelected() method so that if the selected text is a directory, the 'open dialog' appears. Why would someone want this? I've found it useful to be able to easily open the folder that the filename is in, without having to copy and paste the folder name to the clipboard and then paste it into the open dialog box, or to open the selected file using ctrl+o and then having the open dialog using the current folder. Either is two steps and too cumbersome. This suggested revision is to attain the same functionality in one step. April -- They say the older you get, to wiser you get... You must be very, very wise Nermal Garfield ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re: [scite] for your consideration, a patch to OpenSelected()
April White: I've found it useful to be able to easily open the folder that the filename is in, without having to ... Is this seen by others as a commonly needed operation? Everyone works differently and this doesn't seem to me to be something that I'd use. Its not easily discoverable either although possibly some documentation would help. Neil ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
Re: [scite] for your consideration, a patch to OpenSelected()
April White wrote: I have uploaded to http://www.scintilla.org/aprilw/scite-v174dev-openselected-april-2007-08-04.zip a suggested patch to the OpenSelected() method so that if the selected text is a directory, the 'open dialog' appears. I have not attempted to implement this in my GTK machine. Neil, this is the change I mentioned in my JobQueue email that was outside of the scope of changing the job system. April There has been no message on this thread. Does this mean that my suggested patch is rejected? April -- A truly happy person is one who can enjoy the scenery on a detour. ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest
[scite] for your consideration, a patch to OpenSelected()
I have uploaded to http://www.scintilla.org/aprilw/scite-v174dev-openselected-april-2007-08-04.zip a suggested patch to the OpenSelected() method so that if the selected text is a directory, the 'open dialog' appears. I have not attempted to implement this in my GTK machine. Neil, this is the change I mentioned in my JobQueue email that was outside of the scope of changing the job system. April -- Babies are a good way to start people. ___ Scite-interest mailing list Scite-interest@lyra.org http://mailman.lyra.org/mailman/listinfo/scite-interest