Talk:Using your own editor

From ScarletDME
Jump to navigation Jump to search

Diccon 12:16, 27 April 2009 (UTC) - Few suggestions Tom.

  1. Since this is not specific to VIM, can you generalise the var names and the command itself. I know it ultimately calls vim as it is, but simply exchanging the command var means it can be anything as I understand your code (Nano, vi, hell Kate if you have X windows). Called it EDITOR in mine, which is too long a name IMO, and of course EDIT and ED exist :) Any other good names would be good (suggestions?).
  2. It currently screams if you do not have the syntax highlighting qmbasic.vim file there. Either note that the file is not optional or reduce the screaming warning volume. This could break the above mentioned generic nature too, perhaps parametrise it? I've not looked at that bit of code.
  3. Can we have a fail-over question asked if you don't provide details, in a QM Style. Ie no file name, then ask Filename?.. etc. Partly to be consistent, but also because it smooths the CLI flow if you miss a step. ? query function at this point is too much to ask IMO at this time.

Given the above i think it's idea to go into workdevbranch1.

karaken12 13:18, 27 April 2009 (UTC) - The reason for the name is mostly historical -- I wrote this thing so I could use Vim, without thinking about anything else. Personally I'd rather keep it as Vim for now, and you can rename it if you want to use something else. For #2, I agree this is wrong. What it should do is check if the file exists, and then only add the extra bit to the line if it's there. Easily done, but I haven't done it because I never needed to -- see point 1. :o) For point three, that might be a good idea, if that's what people want to do. I rather thought it already did that, but I guess not.

Diccon 12:43, 27 April 2009 (UTC) Also i have some ideas about Dynamic files. Simply Write a BASIC precursor that copies the indervidual record being requested to a TEMP Directory file. When the editor finishes copy back the temp file over the record. If nothing has been altered and the external prog just exited, then you will be copying back an identicle record. If it was altered then the edits are copied in. No clever detection of alterations are needed. This can even implement record locking if you lock before the shell execute and the BASIC prog returns and releases after you exit.

karaken12 13:18, 27 April 2009 (UTC) - This is, in fact, exactly what it already does. :o) But I'm working on some sneaky things that might render this question moot. *taps side of nose*
Diccon 12:05, 1 May 2009 (UTC) - I Quote: "DISCLAIMER: If you use this program to edit a non-directory file, it will overwrite it when you have finished editing. It is very unsafe,...etc". From this i thought you were suggesting it overwrites the whole dynamic file, instead of overwriting the indervidual record. Which is what I'm suggesting. Addmittedly I stared at the mass of code and havent read it through.
karaken12 12:08, 1 May 2009 (UTC) - Sorry, bad use of the word 'file' there! I've changed the wording now, so it should be clearer.