============================================================================= EditJumpTo()
| 4086 | // EditJumpTo() |
| 4087 | // |
| 4088 | void EditJumpTo ( HWND hwnd, int iNewLine, int iNewCol ) |
| 4089 | { |
| 4090 | int iMaxLine = ( int ) SendMessage ( hwnd, SCI_GETLINECOUNT, 0, 0 ); |
| 4091 | // Jumpt to end with line set to -1 |
| 4092 | if ( iNewLine == -1 ) { |
| 4093 | SendMessage ( hwnd, SCI_DOCUMENTEND, 0, 0 ); |
| 4094 | return; |
| 4095 | } |
| 4096 | // Line maximum is iMaxLine |
| 4097 | iNewLine = min ( iNewLine, iMaxLine ); |
| 4098 | // Column minimum is 1 |
| 4099 | iNewCol = max ( iNewCol, 1 ); |
| 4100 | if ( iNewLine > 0 && iNewLine <= iMaxLine && iNewCol > 0 ) { |
| 4101 | int iNewPos = ( int ) SendMessage ( hwnd, SCI_POSITIONFROMLINE, ( WPARAM ) iNewLine - 1, 0 ); |
| 4102 | int iLineEndPos = ( int ) SendMessage ( hwnd, SCI_GETLINEENDPOSITION, ( WPARAM ) iNewLine - 1, 0 ); |
| 4103 | while ( iNewCol - 1 > SendMessage ( hwnd, SCI_GETCOLUMN, ( WPARAM ) iNewPos, 0 ) ) { |
| 4104 | if ( iNewPos >= iLineEndPos ) { |
| 4105 | break; |
| 4106 | } |
| 4107 | iNewPos = ( int ) SendMessage ( hwnd, SCI_POSITIONAFTER, ( WPARAM ) iNewPos, 0 ); |
| 4108 | } |
| 4109 | SendMessage ( hwnd, SCI_SETXCARETPOLICY, CARET_SLOP | CARET_STRICT | CARET_EVEN, 50 ); |
| 4110 | SendMessage ( hwnd, SCI_SETYCARETPOLICY, CARET_SLOP | CARET_STRICT | CARET_EVEN, 5 ); |
| 4111 | iNewPos = min ( iNewPos, iLineEndPos ); |
| 4112 | SendMessage ( hwnd, SCI_GOTOPOS, ( WPARAM ) iNewPos, 0 ); |
| 4113 | SendMessage ( hwnd, SCI_CHOOSECARETX, 0, 0 ); |
| 4114 | SendMessage ( hwnd, SCI_SETXCARETPOLICY, CARET_SLOP | CARET_EVEN, 50 ); |
| 4115 | SendMessage ( hwnd, SCI_SETYCARETPOLICY, CARET_EVEN, 0 ); |
| 4116 | } |
| 4117 | } |
| 4118 | |
| 4119 | VOID HL_Adjust_offset ( int *pos , BOOL in ) |
| 4120 | { |
no outgoing calls
no test coverage detected