2010-07-29 15:49 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbide/hbide.prg
    ! Minor.

  * contrib/hbide/idethemes.prg
    + Added: "PROCEDURE" and "THREAD" as Harbour keywords, got missed somehow.

  * contrib/hbide/ideedit.prg
  * contrib/hbide/ideskeletons.prg
    + Implemented: Code Snippets->execution->Ctrl+K : inserts the snippet
      if word under cursor is one of the name of a code snippet definition.
      So, if you have a snippet named "doit" then immediately after 
      typeing "doit" you press Ctrl_K, then, instead of presenting you 
      with menu to select a snippet, it is executed automatically.
This commit is contained in:
Pritpal Bedi
2010-07-29 22:54:38 +00:00
parent d0c8d54ac7
commit f694e217ee
5 changed files with 43 additions and 14 deletions

View File

@@ -16,6 +16,21 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-07-29 15:49 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/hbide.prg
! Minor.
* contrib/hbide/idethemes.prg
+ Added: "PROCEDURE" and "THREAD" as Harbour keywords, got missed somehow.
* contrib/hbide/ideedit.prg
* contrib/hbide/ideskeletons.prg
+ Implemented: Code Snippets->execution->Ctrl+K : inserts the snippet
if word under cursor is one of the name of a code snippet definition.
So, if you have a snippet named "doit" then immediately after
typeing "doit" you press Ctrl_K, then, instead of presenting you
with menu to select a snippet, it is executed automatically.
2010-07-30 00:13 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/postinst.hbs
! Missed one modification from prev.

View File

@@ -426,7 +426,7 @@ METHOD HbIde:create( aParams )
/* Load Code Skeletons */
hbide_loadSkltns( Self )
/* Set Codec at the Begining */
/* Set Codec at the Begining - no interface display */
HbXbp_SetCodec( ::cWrkCodec )
/* Load IDE|User defined Themes */
@@ -484,8 +484,9 @@ METHOD HbIde:create( aParams )
/* Restore Settings */
hbide_restSettings( Self )
/* Again to be displayed in Statusbar */
HbXbp_SetCodec( ::cWrkCodec )
::oDK:setStatusText( SB_PNL_CODEC, ::cWrkCodec )
//HbXbp_SetCodec( ::cWrkCodec )
//::oDK:setStatusText( SB_PNL_CODEC, ::cWrkCodec )
::setCodec( ::cWrkCodec )
::oDK:setStatusText( SB_PNL_THEME, ::cWrkTheme )
/* Display cWrkEnvironment in StatusBar */

View File

@@ -2394,6 +2394,8 @@ FUNCTION hbide_isIndentableKeyword( cWord, oIde )
FUNCTION hbide_isHarbourKeyword( cWord, oIde )
STATIC s_b_ := { ;
'function' => NIL,;
'procedure' => NIL,;
'thread' => NIL,;
'return' => NIL,;
'request' => NIL,;
'static' => NIL,;

View File

@@ -332,19 +332,30 @@ METHOD IdeSkeletons:selectByMenuAndPostText( qEdit )
IF !empty( ::aSkltns )
qCursor := QTextCursor():from( qEdit:textCursor() )
qRect := QRect():from( qEdit:cursorRect( qCursor ) )
qMenu := QMenu():new( qEdit )
FOR EACH a_ IN ::aSkltns
qMenu:addAction( a_[ 1 ] )
NEXT
/* Look for if a macro is executed */
qCursor:select( QTextCursor_WordUnderCursor )
cText := qCursor:selectedText()
IF !empty( cText ) .AND. ascan( ::aSkltns, {|e_| e_[ 1 ] == cText } ) > 0
qCursor:insertText( "" )
qEdit:setTextCursor( qCursor )
::postText( qEdit, ::getText( cText ) )
pAct := qMenu:exec_1( qEdit:mapToGlobal( QPoint():new( qRect:x(), qRect:y() ) ) )
IF !hbqt_isEmptyQtPointer( pAct )
qAct := QAction():from( pAct )
ELSE
qRect := QRect():from( qEdit:cursorRect( qCursor ) )
IF !empty( cText := ::getText( qAct:text() ) )
::postText( qEdit, cText )
qMenu := QMenu():new( qEdit )
FOR EACH a_ IN ::aSkltns
qMenu:addAction( a_[ 1 ] )
NEXT
pAct := qMenu:exec_1( qEdit:mapToGlobal( QPoint():new( qRect:x(), qRect:y() ) ) )
IF !hbqt_isEmptyQtPointer( pAct )
qAct := QAction():from( pAct )
IF !empty( cText := ::getText( qAct:text() ) )
::postText( qEdit, cText )
ENDIF
ENDIF
ENDIF
ENDIF

View File

@@ -173,7 +173,7 @@ METHOD IdeThemes:create( oIde, cThemesFile )
aadd( ::aPatterns, { "PreprocessorDirectives", s, .f. } )
/* Harbour Keywords */
b_:= { 'function','return','static','local','default', ;
b_:= { 'function','procedure','thread','return','static','local','default', ;
'if','else','elseif','endif','end', ;
'docase','case','endcase','otherwise', ;
'switch','endswitch', ;