SCIPAD BUGS AND WISHES LIST

Bugs:
-----
-colorization:
 . the regexp for the new class "numbers" is not perfect, e123 or d1 are
   caught as number
 . multiple matrix transposes in the same line are colorized as textquoted, 
   e.g. A=A'+B'
 . line-breaks (..) are not handled for quoted strings colorization

-issues related with non colorizing single quoted text:
  . code lines such as mprintf("%s",'this is a function') brakes the line
    number counting in functions if not properly colorized as textquoted.
  . mprintf('['); is detected as a continued line, and this results in
    wrong line number in function displayed in statusind2

-Ctrl-v copies also inside the find/replace/filename dialogs, but does not
 replace an existing selection. Problem of setting up the proper bindings,
 likely. Note: this happens only on some platforms.

-Line number finding in functions may provide wrong results in some pathological
 cases of continued lines, namely:
 . "Mixed" continued lines, i.e. a single cont line splitted in many buffer lines,
   some of them containing dots and some other not
 . Nested brackets or braces in continued lines

-Undo/redo stacks are sometimes not consistent with the modified flag, e.g. if the user
 types something, then saves, then undo once and redo once, then the modified flag is
 active. Instead of debugging the current code, the best fix would probably be to make
 profit of the undo/redo mechanism embedded in text widgets since tcl/tk 8.4. But this
 supposes that the minimal version is 8.4, which is true only for the binary distribution
 of Scilab. The latest changes in the configure files require now 8.4 however.

-Control-k deletes from the insertion cursor to the end of its line; if the insertion
 cursor is already at the end of a line, then Control-k deletes the newline character.
 This is normal, but the buffer should be reported as modified.
 Same issue for Control-t also, as well as for all the default bindings of the TK text
 widget that we did not overload by our own Scipad bindings.
 More precisely, the binded action is performed by the system, the buffer is
 NOT reported as modified by Scipad, but the action can be undone by Ctrl-z.

-In the debugger, trying to F10 with something like:
    function ...
                    function_name
        instruction
        instruction
    enfunction
 fails. This is due to a bug in tcl/tk itself and will be solved in 8.5
 See: http://www.cs.man.ac.uk/fellowsd-bin/TIP/113.html
 For the time being, the keyword "function" and the function name MUST be
 on the same code line.

-Some shortcuts may not work on certain platforms. E.g. Control-F1 does not on
 at least one Mandrake 10.1 Official Linux. Was also found on a RH8 machine.

-Ctrl-F1 on some characters like " ' - or + does not work (different errors in
 the shell. Problem is partly in sciGUI, and partly in Scipad.

-Resizing of the watch window panes can sometimes lead to clipping of these
 panes. This is Tk bug 1192323 (partially solved in Tk8.5a3 cvs 29/04/05).
 Tk patch 1124198 should solve the issue once committed into Tk cvs.

-On Windows, trying to save a file in C:\Documents and Settings\<account>\My Documents
 usually produces a read-only warning and prevents the user from saving there.
 This is Tcl bug 1193497.


Old bugs/whishes which have been hacked but could have been done better:
------------------------------------------------------------------------

-if a copy-paste modification on a buffer is undone once too much, a 
 "lifo($id) pop error, empty" results
 -- This is now done, but perhaps not correctly. Just added a catch as I was
  not proficient enough to find out why the commandStack and the cursorStack
  gain different last element index only once a paste has been performed.
  Note: tcl/tk8.4.6 now supports directly undo/redo in text widgets, and takes
  care of the modified flag. Could therefore get rid of all this code.

- (the text cursor disappears every now and then while moving it around 
  with the arrows, known bug #865 of the linux scilab-tcl combination)
  -- now hacked:  the cursor is always on and red but does not blink,
    for linux (normal blinking for windows).

-the window geometry is now managed in pixels. This is fine for restoring
 exactly the same window geometry as in the previous session, but loses
 some advantages of the previously broken grid management, such as resize
 of the window upon font size changes.

-added  "evaluate selection",  i.e.  send to  scilab  only the  selected
 text. It is  done, but: a) I  had has to translate \n  in commas (a very
 long line can result, but I  found that up  to ~16300 char is  ok for
 execstr); b) it used to go amok if the selection contains "function" 
 without "endfunction" [scilab problem - with the latest CVS that should
 be fixed]; c) I hacked that  comments are stripped off, but wasn't
 proficient enough  to treat "xxx//xxx"  strings; d) it  doesn't output
 nicely the strings passed on scilab's shell. Likely all this has to do
 with limitations  of ScilabEval [execstr()].   In at least  one windows
 version (old  ScilabEval? the command  is catched by the  history) the
 first character of the command is  dropped (it was a known issue about
 Copy/Paste).  I  do not hack-prepend a  space, as the  bug lies likely
 there.
Note: this is continuously changing and platform dependent. scilab 3.0RC1 has
~4000 chars for linux and ~500 for windows. This has to do with the mechanics
of ScilabEval and the command queue space.
A workaround could be to via execstr(TK_GetVar), but then scipad has to be
launched inside the master tk interpreter (perhaps in a namespace) and not 
in a slave interpreter.

-command for indenting/unindenting. Now I just duplicated the Comment/uncomment
 stuff, which works fine but just for two spaces. This is a "hard indentation":
 physical insertion/removal of spaces; someone made provisions for a tag 
 "indentation". probably a logical one. I think physical is more general.

-after a paste (either Ctrl-v or 2nd-button), the selection is cleared. 
 I could as well have left it in the old place with the cursor at 
 the insertion point - but then typing erases the selection even if the 
 cursor is somewhere else. A matter of taste. The two copy paste methods
 are not identical since now the latter is equivalent to a copy-paste 
 operation, so I could even decide a different option for each of the two.

-2nd-button now succeds in importing an X external selection into scipad
 under linux. With one remaining glitch, the insertion cursor zomps back
 to the beginning of the insertion at the end of the process.
 Under windows 2nd-button is ineffective if the selection is external, 
 but has the side effect (with some glitches) to drop at the mouse point the
 selection it is within scipad

-the debugger works well for functions but shell scripts are not supported yet.
 Step by step execution remains to be implemented, but this requires Scilab
 core support.


Wishes:
-------

-default fonts modifiable within the program 

-parentheses and brackets get colorized in colors according to their level
 of nesting

-unmatched parentheses are highlighted (e.g. stroke-tru) like in Matlab's 
 editor

-colorization supports different sets of keywords: e.g. for scopes,
 % constants, hardcoded functions, distribution macros, toolbox additions;
 dynamical colorization (the current loaded functions, defined global 
 variables are highlighted properly -
 the list could be read either at scipad startup or resfreshed on
 demand) [now partially implemented for dynamical predefs and library 
 functions]

-highlighting of for--end, while--end, select--end blocks while
 typing, like for parentheses; scope background remains highlighted in a
 background tint (choose a suitable scheme for nested structures), OR,
 block keywords are highlighted in different colors than standard keywords.

-a taylored 3rd-button popup menu (currently it is just the edit menu) - i.e.
 it includes execute selection, comment/uncomment this line, insert/delete
 breakpoints
 Note: a first step to this has been implemented. During a debug session, 
 the popup menu is a debug menu.

-smart indentation (i.e., for automatically indents the next line, end
 automatically indents back, etc)
 Note: proc scipadindent should be removed, since scipad now uses physical
 indentation
 
-"auto smart wrap on": lines exceeding a margin could be truncated at
 word boundaries with .. dots and \n
 
-(customizable?) tool bar
 Note: a first step to this has been implemented in the debugger watch window.
 
-paned window, to allow for viewing two different parts of the text buffer at
 the same time, or maybe two different buffers.

-tile or cascade windows inside the pad
 
-add a 'Go to function...' entry in a menu. Upon selection, a sub-menu would
 open allowing for selection of any function found in all the currently 
 opened buffers.
 Could also be displayed in a combobox (but tk does not support combos 
 natively - Note however that BWidgets-1.7.0 is now part of the CVS 
 distribution, and that it includes combos!) which would be part of the 
 tool bar. Or a spinbox plus a 'Go' button. The buffer search could be 
 launched only on invocation of the spinbox arrows or on menu selection.

-add a "Go to line N in function..." and "Go to logical line", which take into 
 account continued lines, procedures and menu entries.

-subwindows (e.g Find.., file choosers, debugger, tk_messageBoxes...)
 should inherit the current font size

-Conditional breakpoints

-Allow to watch an element of a variable, and not only the variable array 
(i.e. to watch d(1) and not only d if d is a matrix). 
 Problem: if d exists in Scilab, exists(d) is true
 but exists(d(1)) is false!
 Allow to watch a generic expression (bonus: the expression could be e.g.
 a graphical command, so that an array is *plotted* at each breakpoint)
 Way to go: add a pane with expressions to be executed and result of their
 evaluation displayed in the watch window area (e.g. size(a_matrix,"*"))

-Improve the aesthetics of Scipad (see sciGUI)

-Blink (single or double) quotes. Must find a way to distinguish between 
 opening and closing quotes in proc blinkbrace. This is not that easy since
 these are the same character, therefore the direction to search is difficult
 to determine. Note that there is currently an old proc insquote that is
 never called and could be removed from the Scipad source

-'Matlab' colorization scheme for .m files

-On successful opening of the first file after Scipad launch, automatically
 close the unmodified empty buffer that is opened by default

-Scipad defines and uses, mostly for the debugger, some variables in order to
 send values to Scipad. All these variables currently start with the prefix 
 db_, in order to reduce the risk of the use of such variable names in Scilab
 for another purpose, e.g. in the function to be debugged. We could use more
 sophisticated things to be absolutely sure that the variable names 
 instantiated by Scipad in not used in Scilab, so that conflicts would 
 always be avoided. For instance, browsing the existing known
 variables and checking for existence, etc. could be used.

-Make printing from Scipad work on Linux and implement it for Windows.
 Try to preserve the colorization in the process.
 Possible references for implementation on a Windows box are:
 http://wiki.tcl.tk/11319
 http://wiki.tcl.tk/9846
 http://pages.infinit.net/cclients/files/tkprint1.1.html
 http://wiki.tcl.tk/2497
 http://aspn.activestate.com/ASPN/Cookbook/Tcl/Recipe/284848

-Highlight wrapped lines so that they can be more easily identified.
 Could make use of indentation or other suitable scheme TBD, or add
 some sort of left grey band in which some more information could be
 put (breakpoint pink dot, yellow arrow to show the next instruction
 to be executed like in Visual C++ or Matlab, or wrapped lines sign).

-Colorization progressbar. Could be an overlay on the left status area,
 incrementing over the "Wait seconds for loading..." message.

-Add underlined numbers in the Windows menu, as for the File menu.

-The find/replace entries in the dialog could be comboboxes retaining
 the strings previously searched or replaced

-Add an eventual "revert to defaults button" (colors option menu)

-Carefully study whether the debugger would benefit from using editvar
 or browsevar for the watch window variables. At least one drawback:
 sciGUI is not localized.

-switch to flexible Alt underlines in dialogs

-Avoid to destroy and recreate the whole watch window when hiding/displaying
 one of its sub-areas. Would probably require -hide option for panedwindow,
 but this one is only available from Tk 8.5 (TIP #179)

-Make use of the native Tk Find/Replace dialog available from 8.5
