亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? undo.c

?? nedit 是一款linux下的開發源碼的功能強大的編輯器
?? C
?? 第 1 頁 / 共 2 頁
字號:
static const char CVSID[] = "$Id: undo.c,v 1.14 2002/08/27 05:39:27 n8gray Exp $";/********************************************************************************									       ** undo.c -- Nirvana Editor undo command					       **									       ** Copyright (C) 1999 Mark Edel						       **									       ** This is free software; you can redistribute it and/or modify it under the    ** terms of the GNU General Public License as published by the Free Software    ** Foundation; either version 2 of the License, or (at your option) any later   ** version.							               ** 									       ** This software is distributed in the hope that it will be useful, but WITHOUT ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        ** FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License        ** for more details.							       ** 									       ** You should have received a copy of the GNU General Public License along with ** software; if not, write to the Free Software Foundation, Inc., 59 Temple     ** Place, Suite 330, Boston, MA  02111-1307 USA		                       **									       ** Nirvana Text Editor	    						       ** May 10, 1991								       **									       ** Written by Mark Edel							       **									       ********************************************************************************/#ifdef HAVE_CONFIG_H#include "../config.h"#endif#include "undo.h"#include "textBuf.h"#include "text.h"#include "nedit.h"#include "search.h"#include "window.h"#include "file.h"#include "userCmds.h"#include "preferences.h"#include <string.h>#ifdef VMS#include "../util/VMSparam.h"#else#ifndef __MVS__#include <sys/param.h>#endif#endif /*VMS*/#include <Xm/Xm.h>#include <Xm/Text.h>#ifdef HAVE_DEBUG_H#include "../debug.h"#endif#define FORWARD 1#define REVERSE 2static void addUndoItem(WindowInfo *window, UndoInfo *undo);static void addRedoItem(WindowInfo *window, UndoInfo *redo);static void removeUndoItem(WindowInfo *window);static void removeRedoItem(WindowInfo *window);static void appendDeletedText(WindowInfo *window, const char *deletedText,	int deletedLen, int direction);static void trimUndoList(WindowInfo *window, int maxLength);static int determineUndoType(int nInserted, int nDeleted);static void freeUndoRecord(UndoInfo *undo);void Undo(WindowInfo *window){    UndoInfo *undo = window->undo;	int restoredTextLength;        /* return if nothing to undo */    if (undo == NULL)    	return;        /* BufReplace will eventually call SaveUndoInformation.  This is mostly       good because it makes accumulating redo operations easier, however       SaveUndoInformation needs to know that it is being called in the context       of an undo.  The inUndo field in the undo record indicates that this       record is in the process of being undone. */    undo->inUndo = True;        /* use the saved undo information to reverse changes */    BufReplace(window->buffer, undo->startPos, undo->endPos,    	    (undo->oldText != NULL ? undo->oldText : ""));        restoredTextLength = undo->oldText != NULL ? strlen(undo->oldText) : 0;    /* position the cursor in the focus pane after the changed text       to show the user where the undo was done */    TextSetCursorPos(window->lastFocus, undo->startPos + restoredTextLength);    if (GetPrefUndoModifiesSelection()) {        if (restoredTextLength > 0) {    	    BufSelect(window->buffer, undo->startPos, undo->startPos + restoredTextLength);        }        else {    	    BufUnselect(window->buffer);        }    }    MakeSelectionVisible(window, window->lastFocus);    /* restore the file's unmodified status if the file was unmodified       when the change being undone was originally made.  Also, remove       the backup file, since the text in the buffer is now identical to       the original file */    if (undo->restoresToSaved) {    	SetWindowModified(window, False);    	RemoveBackupFile(window);    }        /* free the undo record and remove it from the chain */    removeUndoItem(window);}void Redo(WindowInfo *window){    UndoInfo *redo = window->redo;    int restoredTextLength;    /* return if nothing to redo */    if (window->redo == NULL)    	return;    /* BufReplace will eventually call SaveUndoInformation.  To indicate       to SaveUndoInformation that this is the context of a redo operation,       we set the inUndo indicator in the redo record */    redo->inUndo = True;        /* use the saved redo information to reverse changes */    BufReplace(window->buffer, redo->startPos, redo->endPos,    	    (redo->oldText != NULL ? redo->oldText : ""));     	restoredTextLength = redo->oldText != NULL ? strlen(redo->oldText) : 0;    /* position the cursor in the focus pane after the changed text       to show the user where the redo was done */    TextSetCursorPos(window->lastFocus, redo->startPos + restoredTextLength);    if (GetPrefUndoModifiesSelection()) {        if (restoredTextLength > 0) {    	    BufSelect(window->buffer, redo->startPos, redo->startPos + restoredTextLength);        }        else {    	    BufUnselect(window->buffer);        }    }    MakeSelectionVisible(window, window->lastFocus);        /* restore the file's unmodified status if the file was unmodified       when the change being redone was originally made */	        if (redo->restoresToSaved)    	SetWindowModified(window, False);        /* remove the redo record from the chain and free it */    removeRedoItem(window);}/*** SaveUndoInformation stores away the changes made to the text buffer.  As a** side effect, it also increments the autoSave operation and character counts** since it needs to do the classification anyhow.*//* Note: This routine must be kept efficient.  It is called for every character   typed. */void SaveUndoInformation(WindowInfo *window, int pos, int nInserted,	int nDeleted, const char *deletedText){    int newType, oldType;    UndoInfo *u, *undo = window->undo;    int isUndo = (undo != NULL && undo->inUndo);    int isRedo = (window->redo != NULL && window->redo->inUndo);        /* redo operations become invalid once the user begins typing or does       other editing.  If this is not a redo or undo operation and a redo       list still exists, clear it and dim the redo menu item */    if (!(isUndo || isRedo) && window->redo != NULL)    	ClearRedoList(window);    /* figure out what kind of editing operation this is, and recall       what the last one was */    newType = determineUndoType(nInserted, nDeleted);    if (newType == UNDO_NOOP)    	return;    oldType = (undo == NULL || isUndo) ? UNDO_NOOP : undo->type;            /*    ** Check for continuations of single character operations.  These are    ** accumulated so a whole insertion or deletion can be undone, rather    ** than just the last character that the user typed.  If the window    ** is currently in an unmodified state, don't accumulate operations    ** across the save, so the user can undo back to the unmodified state.    */    if (window->fileChanged) {    	/* normal sequential character insertion */	if (  ((oldType == ONE_CHAR_INSERT || oldType == ONE_CHAR_REPLACE)    	       && newType == ONE_CHAR_INSERT) && (pos == undo->endPos)) {	    undo->endPos++;	    window->autoSaveCharCount++;	    return;	}	/* overstrike mode replacement */	if ((oldType == ONE_CHAR_REPLACE && newType == ONE_CHAR_REPLACE) &&    		   (pos == undo->endPos)) {    	    appendDeletedText(window, deletedText, nDeleted, FORWARD);	    undo->endPos++;	    window->autoSaveCharCount++;	    return;	}	/* forward delete */	if ((oldType==ONE_CHAR_DELETE && newType==ONE_CHAR_DELETE) &&    		   (pos==undo->startPos)) {    	    appendDeletedText(window, deletedText, nDeleted, FORWARD);    	    return;	}	/* reverse delete */	if ((oldType==ONE_CHAR_DELETE && newType==ONE_CHAR_DELETE) &&    		   (pos == undo->startPos-1)) {    	    appendDeletedText(window, deletedText, nDeleted, REVERSE);	    undo->startPos--;	    undo->endPos--;	    return;	}    }        /*    ** The user has started a new operation, create a new undo record    ** and save the new undo data.    */    undo = (UndoInfo *)XtMalloc(sizeof(UndoInfo));    undo->oldLen = 0;    undo->oldText = NULL;    undo->type = newType;    undo->inUndo = False;    undo->restoresToSaved = False;    undo->startPos = pos;    undo->endPos = pos + nInserted;    /* if text was deleted, save it */    if (nDeleted > 0) {	undo->oldLen = nDeleted + 1;	/* +1 is for null at end */	undo->oldText = XtMalloc(nDeleted + 1);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.欧美.com| 国产盗摄一区二区三区| 99国产精品99久久久久久| 欧美日韩mp4| 日韩av电影免费观看高清完整版在线观看| 欧美日韩在线播放三区| 日本麻豆一区二区三区视频| 精品捆绑美女sm三区| 国产成人日日夜夜| 一区二区在线观看视频| 7777精品伊人久久久大香线蕉完整版| 免费一区二区视频| 国产欧美一区视频| 日本乱码高清不卡字幕| 日韩电影免费一区| 国产日韩欧美麻豆| 在线日韩国产精品| 麻豆精品新av中文字幕| 中文一区在线播放| 欧美午夜精品久久久久久超碰| 日韩在线a电影| 亚洲国产精品成人综合色在线婷婷| 91视频免费观看| 麻豆久久久久久| 日韩一区在线看| 日韩欧美一区二区视频| 99re成人精品视频| 一区二区三区在线播| 成人综合日日夜夜| 亚洲桃色在线一区| 日韩欧美亚洲国产另类| 成人理论电影网| 日韩成人免费看| 中文字幕一区二区三区不卡在线| 一本大道综合伊人精品热热 | 91麻豆精品国产综合久久久久久| 国内精品久久久久影院色| 亚洲欧美另类小说| 亚洲精品一区二区三区福利| 色成年激情久久综合| 国产老女人精品毛片久久| 亚洲一区免费视频| 中文乱码免费一区二区| 日韩午夜在线影院| 欧美无人高清视频在线观看| 国产成人在线色| 麻豆精品视频在线观看视频| 亚洲情趣在线观看| 国产午夜精品福利| 日韩视频一区在线观看| 欧洲精品一区二区| 成人美女视频在线看| 韩国女主播成人在线| 亚洲成人三级小说| 亚洲美女视频一区| 中日韩av电影| 久久久精品日韩欧美| 日韩三级av在线播放| 欧美年轻男男videosbes| 色偷偷88欧美精品久久久| 国产成人av资源| 国产精品一区二区在线看| 久久9热精品视频| 日本va欧美va瓶| 天堂av在线一区| 亚洲综合视频网| 亚洲欧美成aⅴ人在线观看| 国产欧美一二三区| 久久精品视频网| 久久蜜桃香蕉精品一区二区三区| 欧美xxxx在线观看| 欧美va亚洲va香蕉在线| 欧美一二三在线| 日韩小视频在线观看专区| 日韩欧美123| 日韩精品一区二区三区swag| 日韩视频免费观看高清在线视频| 欧美一级午夜免费电影| xnxx国产精品| 久久亚洲二区三区| 国产日产欧产精品推荐色| 久久嫩草精品久久久精品| 久久精品欧美日韩| 国产蜜臀av在线一区二区三区| wwwwww.欧美系列| 国产欧美日韩不卡| 中文字幕亚洲欧美在线不卡| 亚洲精选一二三| 亚洲丶国产丶欧美一区二区三区| 777亚洲妇女| 中文字幕av一区二区三区高| 日韩精品一区二区三区中文不卡| 欧美日韩的一区二区| 8x福利精品第一导航| 日韩欧美一区二区不卡| 久久久99久久精品欧美| 国产精品私房写真福利视频| 国产精品国产三级国产三级人妇| 亚洲色图视频网| 偷拍一区二区三区四区| 精品在线观看免费| 成人精品免费看| 欧美午夜一区二区三区免费大片| 欧美日韩第一区日日骚| 久久精品一二三| 亚洲激情六月丁香| 日韩精品色哟哟| 国产精品一区二区三区四区| 色综合久久九月婷婷色综合| 欧美日韩国产一级| 久久久国产综合精品女国产盗摄| 亚洲图片欧美激情| 日本欧美韩国一区三区| 成人动漫一区二区在线| 欧美美女直播网站| 国产日韩精品视频一区| 午夜精品视频在线观看| 成人午夜伦理影院| 91精品国产综合久久久久久 | 毛片av一区二区| 成人三级在线视频| 精品污污网站免费看| 欧美激情在线一区二区| 亚洲国产毛片aaaaa无费看| 国内欧美视频一区二区| 欧美色倩网站大全免费| 精品精品欲导航| 3d动漫精品啪啪一区二区竹菊| 日韩精品一区二区三区视频播放 | 国产亚洲成年网址在线观看| 亚洲美女免费视频| 国产在线精品一区在线观看麻豆| 91蝌蚪porny| 久久亚洲一区二区三区四区| 亚洲成人tv网| 99国产一区二区三精品乱码| 精品裸体舞一区二区三区| 一区二区三区四区蜜桃| 国产福利一区二区三区视频| 911精品国产一区二区在线| 亚洲女人的天堂| 国产91丝袜在线播放九色| 欧美一区二区播放| 亚洲一二三四区| 91免费在线视频观看| 欧美国产精品v| 激情小说欧美图片| 欧美日本一区二区在线观看| 国内精品国产三级国产a久久 | 亚洲精品一区二区三区福利 | 欧美日韩激情一区| 亚洲欧洲另类国产综合| 狠狠网亚洲精品| 日韩天堂在线观看| 视频在线在亚洲| 欧洲色大大久久| 一区二区视频在线看| 99精品欧美一区二区三区小说 | 99精品桃花视频在线观看| 精品国产乱子伦一区| 日本人妖一区二区| 91精品国产高清一区二区三区| 亚洲永久免费视频| 欧美影院一区二区三区| 伊人色综合久久天天人手人婷| 91麻豆精东视频| 亚洲免费在线看| 色乱码一区二区三区88| 一区二区三区欧美在线观看| 日本高清视频一区二区| 亚洲精品国产无套在线观| 欧美一二区视频| 石原莉奈在线亚洲三区| 欧美一级xxx| 国产精品亚洲一区二区三区妖精| 久久青草国产手机看片福利盒子| 国产米奇在线777精品观看| 久久日韩粉嫩一区二区三区| 国产不卡视频在线播放| 国产精品美女久久久久aⅴ国产馆| 成人午夜短视频| 亚洲免费在线看| 91精品国产91综合久久蜜臀| 久久电影网站中文字幕 | 成人午夜视频免费看| 国产精品不卡视频| 国产美女在线精品| www.亚洲色图.com| 欧美日韩视频在线观看一区二区三区| 久久午夜色播影院免费高清| 国产精品一区二区久激情瑜伽| 中文欧美字幕免费| 欧美午夜电影在线播放| 日本三级韩国三级欧美三级| 久久综合给合久久狠狠狠97色69| 成人午夜精品在线| 亚洲va欧美va国产va天堂影院| 欧美成人一区二区| 99re这里只有精品首页| 日本亚洲天堂网|