undo

How to add undo-functionality to HTML5 Canvas?

依然范特西╮ 提交于 2019-12-03 06:09:43
I have a Sketching app done in all HTML5 and Javascript, and I was wondering how I would create an Undo Button, so you could undo the last thing you drew. Any idea? Jonas You have to store all modifications in a datastructure. Then you can delete the latest modification if the user wants to undo it. Then you repaint all drawing operations from your datastructure again. On http://arthurclemens.github.io/Javascript-Undo-Manager/ I have a working example of undo with a canvas element. When you make a modification, you feed the undo manager the undo and redo methods. Tracking of the position in

How to remember multiple tabs' session in terminal? (Alike FF session manager)

戏子无情 提交于 2019-12-03 05:59:34
how does one " undo close-tab " in terminal? And quite related to it, is it possible to remember a session of tabs in terminal ? I mean (alike Firefox) if I close all tabs in a particular terminal window, how do I open with same the next day? Its really useful to remember the terminal session for people like me who use multiple tabs a lot, and do not wish to start the next day with remembering what (and whereall) one was working, when one left the desk the day before. In mouse right-click menu of gnome-terminal, one could easily (and I have ) mistakenly click close tab instead of ' Copy 'and

Command Pattern for undo/redo in paint application

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 03:45:50
I would like to implement undo/redo in a small paint application . It seems the Command Pattern fits the use nicely, but I am unsure how to best implement it. As I understand the pattern, it is necessary to include in each command: The details of the paint operation for purposes of redo (e.g. Line -> start & end points, free form line -> GeneralPath ) The state of the component prior to the change for undo. In this case, that will be a small snapshot image of the area affected by the command. My understanding based on that is that each command needs to be 'atomic' or self contained, with all

VSTO Word 2016: Squiggly underline without affecting undo

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on a real-time language analysis tool that needs to highlight words to draw attention from the writer in Word 2016 using a VSTO add-in, written in .NET4.6.1 with C#. Think of the grammar/spelling check, which adds a squiggly line underneath a word to show you that the word has grammatical or spelling errors. I'm adding a similar feature for some of my own defined rules. I searched around on adding squiggly lines, and stumbled on Font.Underline and Font.UnderlineColor . I set this on the range of a word, and it appears to

how to undo all whitespace changes with git

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a git repo, where I replaced a lot of files locally. git status now shows many many modified files. Some are "really modified", others only differ by line endings. I want the ones that differ only by line endings to go away (git reset them), but I cannot seem to find the linux-piping-foo to make it happen. Bonus points for how to remove files whose only difference is the executable bit. 回答1: This will do it: git diff -b --numstat \ | egrep $'^0\t0\t' \ | cut -d$'\t' -f3- \ | xargs git checkout HEAD -- Run a diff of the working copy

Change Vim swap/backup/undo file name

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to change the way Vim names its swap/backup/undo files? To avoid clutter, I've set options in my ~/.vimrc to dump these files in ~/.vim/tmp/{swap,backup,undo} ; however, as I routinely edit files in different directories with the same name, I often end up with lots of otherwise indistinguishable files and Vim sometimes has trouble recovering. Ideally, I'd like to use the naming scheme that the persistent undo has ( %path%to%file.undo ) for all these auxiliary files; there's no obvious way to set it, but can it be done with Buf

“Undo” history button clear after run macro excel

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a macro that fires on the "Worksheet_SelectionChange" event. The macro validate data of one column, it changes the background color of the cell if its wrong. The problem is after run the macro, it clears the history of changes (Ctrl Z) of all the document, even the history changes of other cells that I didnt validate. How can I solve this problem? Thanks. 回答1: As the others have stated, there is not way to stop a worksheet-changing macro from clearing the undo stack. As another side-effect, you can't undo the macro either without

How do I undo the last Add-Migration command?

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have created a migration using the Add-Migration command, but I'd like to change the name of that migration. How can I undo the migration command, so that I can regenerate it using the new desired name? Is it just a matter of deleting the generated files, or this could be a bad idea? 回答1: If you haven't used Update-Database you can just delete it. If you've run the update then roll it back using Update-Database -TargetMigration "NameOfPreviousMigration" , then delete it. Reference: http://elegantcode.com/2012/04/12/entity-framework

Can I create an undo transaction in Word or Excel? (VSTO)

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I notice that Project 2007 has the functions that allow operations that can be undone to be placed in a single stack item, or "undo transaction". For example: Application.OpenUndoTransaction "Create 6 tasks" Dim i As Integer For i = 1 To 6 ActiveProject.Tasks.Add "UndoMe " & i Next Application.CloseUndoTransaction What this means is that the user can undo all of the actions in a single undo action, rather than 6 times. This would be great to implement in Word and/or Excel, as I'm doing some things in VSTO that make multiple changes at once,

Undo git update-index --skip-worktree

匿名 (未验证) 提交于 2019-12-03 01:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A while ago I did this to ignore changes to a file tracked by git: git update-index --skip-worktree Now I actually want to commit changes to that file to source. How do I undo the effects of skip-worktree ? Thanks, Kevin 回答1: Aha! I simply want: git update-index --no-skip-worktree 回答2: According to http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html , use git ls-files -v to see the "assume unchanged" and "skip-worktree" files marked with a special letter. The "skip-worktree" files are marked with S . Edit : As @amacleod