[Ttssh2-commit] [5327] HT/CHT/ CBT で左右マージンを見るようにした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2013年 6月 20日 (木) 12:04:19 JST


Revision: 5327
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5327
Author:   doda
Date:     2013-06-20 12:04:18 +0900 (Thu, 20 Jun 2013)
Log Message:
-----------
HT/CHT/CBT で左右マージンを見るようにした。

Modified Paths:
--------------
    trunk/teraterm/teraterm/buffer.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/buffer.c
===================================================================
--- trunk/teraterm/teraterm/buffer.c	2013-06-17 17:54:32 UTC (rev 5326)
+++ trunk/teraterm/teraterm/buffer.c	2013-06-20 03:04:18 UTC (rev 5327)
@@ -3240,21 +3240,26 @@
 }
 
 void CursorForwardTab(int count, BOOL AutoWrapMode) {
-	int i;
+	int i, LineEnd;
 	BOOL WrapState;
 
 	WrapState = Wrap;
 
+	if (CursorX > CursorRightM || CursorY < CursorTop || CursorY > CursorBottom)
+		LineEnd = NumOfColumns - 1;
+	else
+		LineEnd = CursorRightM;
+
 	for (i=0; i<NTabStops && TabStops[i] <= CursorX; i++)
 		;
 
 	i += count - 1;
 
-	if (i < NTabStops) {
+	if (i < NTabStops && TabStops[i] <= LineEnd) {
 		MoveCursor(TabStops[i], CursorY);
 	}
 	else {
-		MoveCursor(NumOfColumns-1, CursorY);
+		MoveCursor(LineEnd, CursorY);
 		if (!ts.VTCompatTab) {
 			Wrap = AutoWrapMode;
 		}
@@ -3265,13 +3270,18 @@
 }
 
 void CursorBackwardTab(int count) {
-	int i;
+	int i, LineStart;
 
+	if (CursorX < CursorLeftM || CursorY < CursorTop || CursorY > CursorBottom)
+		LineStart = 0;
+	else
+		LineStart = CursorLeftM;
+
 	for (i=0; i<NTabStops && TabStops[i] < CursorX; i++)
 		;
 
-	if (i < count) {
-		MoveCursor(0, CursorY);
+	if (i < count || TabStops[i-count] < LineStart) {
+		MoveCursor(LineStart, CursorY);
 	}
 	else {
 		MoveCursor(TabStops[i-count], CursorY);



Ttssh2-commit メーリングリストの案内
Back to archive index