亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
激情综合亚洲精品| 国产精品传媒视频| 欧美在线免费观看亚洲| 成人国产亚洲欧美成人综合网 | 国产精品久久久久9999吃药| 欧美哺乳videos| 欧美videos大乳护士334| 91麻豆精品国产91久久久久| 6080国产精品一区二区| 欧美一区二区三区视频在线观看| 欧美日韩激情一区二区| 欧美丰满少妇xxxxx高潮对白| 欧美蜜桃一区二区三区| 欧美一区二区三区系列电影| 欧美电影影音先锋| 91麻豆精品国产91久久久久| 欧美一区二区三区免费视频| 精品国产乱码久久久久久久| 国产欧美一区二区在线观看| 国产精品天天看| 夜夜夜精品看看| 免费在线一区观看| 国产成人在线免费| 色欧美乱欧美15图片| 欧美丰满高潮xxxx喷水动漫| 日韩欧美激情四射| 欧美激情一区二区三区| 一区二区三区中文字幕精品精品| 亚洲成a天堂v人片| 国产一区二区看久久| 99国产精品视频免费观看| 欧美四级电影网| 久久久91精品国产一区二区精品 | 黄页视频在线91| 大桥未久av一区二区三区中文| 色综合久久88色综合天天6 | 国产美女一区二区| 97精品久久久久中文字幕 | 成a人片国产精品| 欧洲生活片亚洲生活在线观看| 日韩午夜激情免费电影| 中文字幕精品—区二区四季| 亚洲国产一区二区视频| 国产成人丝袜美腿| 欧美日韩国产电影| 国产亚洲成aⅴ人片在线观看| 一区二区三区中文在线| 粉嫩一区二区三区性色av| 欧美日韩二区三区| 中文字幕一区二区不卡| 另类中文字幕网| 欧美日韩极品在线观看一区| 国产精品女同一区二区三区| 蜜臀av亚洲一区中文字幕| 一本色道久久综合亚洲精品按摩| 日韩欧美激情四射| 日日摸夜夜添夜夜添国产精品| 99久久久久免费精品国产| 精品欧美久久久| 亚洲h动漫在线| 95精品视频在线| 国产精品网友自拍| 国产成人av电影| 久久久精品免费网站| 久久er精品视频| 日韩一区二区三免费高清| 亚洲一区二区精品视频| 色偷偷一区二区三区| 亚洲欧美视频一区| 国产精品亚洲人在线观看| 欧美美女bb生活片| 亚洲二区在线观看| 欧美午夜寂寞影院| 亚洲小说欧美激情另类| 欧美午夜影院一区| 亚洲成人7777| 69堂精品视频| 日日摸夜夜添夜夜添精品视频| 欧美精品日日鲁夜夜添| 五月天中文字幕一区二区| 欧美在线观看视频一区二区| 亚洲一区二区三区视频在线播放| 91尤物视频在线观看| 亚洲卡通欧美制服中文| 91福利资源站| 三级精品在线观看| 精品国产免费久久 | 亚洲日本成人在线观看| 99视频精品在线| 亚洲自拍另类综合| 欧美精品三级日韩久久| 久久国内精品视频| 欧美高清在线精品一区| 99国产精品视频免费观看| 亚洲一级二级三级| 91精品国产色综合久久不卡蜜臀 | 欧美韩国日本不卡| 91在线码无精品| 午夜精品久久久久| 亚洲激情六月丁香| 欧美亚洲一区三区| 日本不卡视频在线| 国产欧美日韩精品一区| 99热国产精品| 日本视频一区二区三区| 国产午夜精品福利| 91传媒视频在线播放| 日韩av不卡在线观看| 国产日产精品一区| 欧美在线影院一区二区| 男男视频亚洲欧美| 亚洲日本丝袜连裤袜办公室| 日韩一区二区精品在线观看| 懂色一区二区三区免费观看| 亚洲午夜精品久久久久久久久| www日韩大片| 欧美视频完全免费看| 国产精品影视在线| 亚洲国产毛片aaaaa无费看| 久久影音资源网| 欧美性感一类影片在线播放| 国产乱色国产精品免费视频| 亚洲制服丝袜一区| 国产精品少妇自拍| 日韩三级中文字幕| 色综合色狠狠天天综合色| 激情丁香综合五月| 免费成人在线观看| 亚洲小说欧美激情另类| 中文字幕日韩一区| 日韩精品在线看片z| 在线免费一区三区| 成人一区二区三区视频| 精品一区二区三区欧美| 天天色图综合网| 亚洲人精品午夜| 国产精品免费网站在线观看| 精品国产一区二区三区久久影院| 欧美影视一区在线| 99久久国产综合精品女不卡| 国产精品一区一区三区| 精品亚洲国内自在自线福利| 三级久久三级久久久| 亚洲高清不卡在线| 亚洲一区视频在线| 亚洲激情校园春色| 一区二区三区 在线观看视频| 1区2区3区国产精品| 国产精品久99| 中文字幕五月欧美| 精品成a人在线观看| 国产欧美一区二区精品性| 国产成人综合网| 日本美女一区二区三区| 亚洲小说欧美激情另类| 一区二区三区不卡视频| 一区二区在线观看视频在线观看| 18欧美亚洲精品| 亚洲欧美乱综合| 亚洲黄色录像片| 亚洲一区影音先锋| 亚洲成av人片一区二区梦乃| 亚洲综合色区另类av| 亚洲小说欧美激情另类| 亚洲va韩国va欧美va| 青草av.久久免费一区| 免费观看在线综合| 激情综合五月婷婷| 福利电影一区二区三区| 不卡一区中文字幕| 色婷婷精品久久二区二区蜜臀av | 亚洲免费在线看| 夜夜精品视频一区二区| 午夜精品爽啪视频| 麻豆精品久久久| 成人永久aaa| 色婷婷久久久亚洲一区二区三区| 欧美亚洲图片小说| 日韩精品一区二| 欧美极品少妇xxxxⅹ高跟鞋 | 国产精品久久久久久妇女6080| 国产女人aaa级久久久级| 亚洲人成网站精品片在线观看| 亚洲精品少妇30p| 日本不卡一区二区| 国产精品99久久久久久久女警| 99久久er热在这里只有精品66| 欧美在线观看视频一区二区| 欧美成人猛片aaaaaaa| 国产精品久久久久桃色tv| 亚洲成a人v欧美综合天堂下载| 精油按摩中文字幕久久| proumb性欧美在线观看| 欧美久久久久久久久| 国产欧美综合色| 日韩av高清在线观看| 99精品欧美一区二区三区小说| 欧美一区二区黄色| 成人免费视频在线观看| 精品亚洲成a人在线观看|